0 Up votes0 Down votes

62 views33 pagesdata structure notes

May 03, 2013

© Attribution Non-Commercial (BY-NC)

PDF, TXT or read online from Scribd

data structure notes

Attribution Non-Commercial (BY-NC)

62 views

data structure notes

Attribution Non-Commercial (BY-NC)

- Week 7_ Network Models
- CS270 Final Exam
- be-3-to-8-COMP-Engg
- treeview_progressbar
- Search Bridge Online
- E Cuaresma Presentation
- Lab Manual1
- Fall_2011_CS301_1
- Week16 Trees
- Genetic Programming
- Sas Ken
- File Structure Programs
- Lecture 12
- Quiz
- Data Structures Aptitude
- Linked List Example
- DS GFG
- basic computer mcqs pdf by allonlinefree.com.pdf
- Multimodal Archetypes for 802.11 Mesh Networks
- 9691_s08_qp_1

You are on page 1of 33

Nor Bahiah Hj Ahmad & Dayang Norhayati A. Jawawi

Objectives:

By the end of the class, students are expected to understand the following: problem solving introduction algorithm concept data structure concept

Software engineering

Provides techniques to facilitate the development of computer program

Problem solving

Taking the statement of a problem and develop a computer program to solve problems. The entire process requires to pass many phases, from understanding the problem, design solution and implement the solution.

Problem Solving

A solution to a problem is computer program written in programming language which consist of modules.

Type of Modules:

A single, stand-alone function A method of a class A class Several functions or classes working closely together Other blocks of code

Problem Solving

A good solution consists of : Modules that

organize data collection to facilitate operations must store, move, and alter data use algorithms to communicate with one another

Modularity

Advantage of module:

Constructing programs small/large modules Debugging programs task of debugging large programis reduced to small modular program. Reading programs- easier to understand compared to large program Modifying programs reduce large modification by concentrating on modules Eliminating redundant code by calling the modules will avoid the same code to be written multiple times

Modularity Example

book title year author publisher price getData() print() checkPrice() checkPublisher()

produce

12/8/2011

Algorithm

Module implements algorithms Algorithm: a step-by-step recipe for performing a task within a finite period of time Algorithms often operate on a collection of data, which is stored in a structured way in the computer memory (Data Structure) Algorithms: Problem solving using logic

Algorithm

Well-defined instructions in algorithm includes: 1. when given an initial state, (INPUT) 2. proceed through a well-defined series of successive states, (PROCESS) 3. eventually terminating in an end-state (OUTPUT)

Algorithm

Algorithm

3 types of algorithm basic control structure

Sequential Selection Repeatition (Looping)

Algorithm

Basic algorithm characteristics Finite solution Clear instructions Has input to start the execution Has output as the result of the execution Operate effectively

Flowchart, pseudo code, language etc Factors for measuring good algorithm Running time Total memory usage

Data Structure

A way of storing and organizing data in a computer so that it can be used efficiently Choosing the right data structure will allow the most efficient algorithm to be used A well-designed data structure : allows a variety of critical operations to be performed anable to use few resources, both execution time and memory space, as possible

Data Structure

Operations to the Data Structure

Traversing- access and process every data in data structure at least once Searching search for a location of data Insertion insert item in the list of data Deletion - delete item from a set of data Sorting sort data in certain order Merging merge multiple group of data

Data Types

2 data types

1. Basic data types and 2. structured data types

Integral

Boolean bool Enumeration enum Character char Integer short, int, long Floating point float, double

Data Types

Unsorted Linked List

Network Array Sorted Linked List

Graph

Storage Structure

Structure (struct)

Queue

State Structure

Stack

Data Types

Structured Data Types

Array can contain multiple data with the same types Struct can contain multiple data with different type

typedef struct { int age; char *name; enum {male, female} gender; } Person;

Data Types

Linked Data Structure

Linear Data Structure with restriction

Queue & Stack

Unsorted linked list Sorted linked list

Binary Tree Graph

Queue

First-In-First-Out (FIFO) data structure the first element added to the queue will be the first one to be removed (post office, bank etc)

Queue Application

Stack

Based on the principle of Last In First Out (LIFO) Stacks are used extensively at every level of a modern computer system (compiler etc.)

In Out Top

Stack Application

Linked list consists of:

a sequence of nodes, data fields one or two links or references pointing to the next and/or previous nodes

12

11

Sorted linked list

Data stored in ascending or descending order with no duplicates Insertion at front, middle or rear of the list Deletion will not affect the ascending / descending order of the list

A linked list with no ordering

Tree

A data structure based on a tree structure A tree structure is a way of representing the hierarchical nature of a structure in a graphical form a binary tree is a tree data structure in which each node has at most two children Used for searching big amount of data

Tree

Root Children of node 20 vertex

leaf

Sibling

Graph

A graph consists of a set of vertices, and a set of edges, such that each edge is a connection between a pair of vertices. Some applications require visiting every vertex in the graph exactly once.

Graph

The application may require that vertices be visited in some special order based on graph topology. Examples: Artificial Intelligence Search (Breadth-first search, depth first search) Shortest paths problems Web sites containing a link to and from other websites. Graph that represent courses and the pre-requisites.

Graph Example

Directed

Undirected graph

Network

Network is a directed graph. Can be used to represent a route. Example :

A route for an airline. A route for delivery vehicles.

Network Example

Weighted network that represents a route for a delivery truck. The route shows all cities in Johor for the truck to deliver items and the time taken for a journey from one city to another.

Conclusion

In this class you have learned about: Problem solving is the entire process of taking the statement of a problem and develop a computer program to solve problems. Algorithm is step-by-step recipe for performing a task operate on a collection of data Data structure is a way of storing and organizing data in a computer, it allows efficient algorithm to be used The knowledge given is to ensure that you are able to provide good solution to problem solving

References

Frank M. Carano, Janet J Prichard. Data Abstraction and problem solving with C++ Walls and Mirrors. 5th edition (2007). Addision Wesley. Nor Bahiah et al. Struktur data & algoritma menggunakan C++. Penerbit UTM. 2005.

- Week 7_ Network ModelsUploaded byToy Boy Kl Sam
- CS270 Final ExamUploaded byalanvista
- be-3-to-8-COMP-EnggUploaded bymrboyed
- treeview_progressbarUploaded byrajeev020
- Search Bridge OnlineUploaded byRavi Gohel
- E Cuaresma PresentationUploaded byjayroldparcede
- Lab Manual1Uploaded byRadha Thiruppathi
- Fall_2011_CS301_1Uploaded byAhsan Cheema
- Week16 TreesUploaded byDylan Gray
- Genetic ProgrammingUploaded byMadigani Prasanna
- Sas KenUploaded byAjay Pandey
- File Structure ProgramsUploaded bybala2266
- Lecture 12Uploaded byMrunal Ruikar
- QuizUploaded byRajeev Pathak
- Data Structures AptitudeUploaded bySundeep Chopra
- Linked List ExampleUploaded byFaruq Al-Zacharia
- DS GFGUploaded bychantaiah
- basic computer mcqs pdf by allonlinefree.com.pdfUploaded byahmedalidanish15
- Multimodal Archetypes for 802.11 Mesh NetworksUploaded byjose_anderson_5
- 9691_s08_qp_1Uploaded byAbel
- Convergecast Tc v3Uploaded byKongu Boopathi Kumar
- Security Development Tool AX 2012Uploaded byAgus Prasetyo
- Linked ListsUploaded byabdullah1996
- Mobile Phone Tracking System - Progamming AssignmentUploaded byYash Garg
- IBPS SO IT Officer Model Paper 3Uploaded byAMIT KUMAR
- algorithmsandflowcharts-130417151609-phpapp01Uploaded bynawabrp
- Practice 2Uploaded bySenior Alonzo
- Lecture18_April7Bb (5)Uploaded byzach
- Module3_DMW.docxUploaded bymuhammed nishad
- A car average 12 kilometers per liter.docxUploaded byvijay

- BatteryUploaded bysupermannon
- How to Open Your Spiritual Chakras_ 8 Steps (with Pictures).pdfUploaded bySaša Gagić
- Kinds of NounsUploaded byNylram Sentoymontomo Airomlav
- Dandy Dungco Case DigestUploaded byJahzel Dela Pena Carpio
- Numpy UserUploaded byJonathan Martinez Galindo
- Chapter 5Uploaded byMayana Ibrahim Khan
- Csec 2017 TdUploaded byYɵʉňğ Ģênnä
- E-59.pdfUploaded byrijilpoothadi
- Visual Basic Practice Problems 2006-2007Uploaded byabdul11q
- Tests on AptitudeUploaded byAnonymous v5QjDW2eHx
- Did Einstein Prove That God ExistsUploaded byPraveen Kumar
- ASSE - World Heritage ID CardUploaded byNishat T Tiothy
- Ammonical NitrogenUploaded byYogesh Dhekale
- 4.LTE Overview 69Uploaded bymehdi_mehdi
- There is No Place Like HomeUploaded byAleena Muneer
- Alcohol Consumption and cancerUploaded byBoris Herbas Torrico
- WT98Q001_04gb.pdfUploaded byrpicho
- 101 Questions to Ask About Your LifeUploaded byadam ho
- Designing Reactive SystemsUploaded byady.margaritescu
- ZillowGroupReport2016-11bcadUploaded byscrapdigity
- History of Accounting Thought-1Uploaded byValentino Aris
- Inspection of Quality Control LaboratoriesUploaded byschumon
- elder-holland-the-miracle-of-a-mission.pdfUploaded byElder Cameron Romney
- 113_ERP607_BPD_EN_PKUploaded byaftabyousuf
- Soft Tissue Transfer ModelsUploaded byWarDot Ajah
- The Zeitgeist Movement Defined 6 by 9Uploaded byPatrik Lövström
- Characteristics of Surface Acoustic Waves in (100) AlN/64oYX-LiNbO3 StructuresUploaded bySEP-Publisher
- TN380 Deflection Criteria 062510Uploaded byDiego Felipe Serrano Villabona
- EAWB Product SheetUploaded bygeoinsys
- casion disease.pdfUploaded byYudi

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.