Upcoming SlideShare
×

CD 211 Lecture 01 - Introduction to data structures

865 views

Published on

Published in: Education
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
865
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
0
0
Likes
0
Embeds 0
No embeds

No notes for slide

CD 211 Lecture 01 - Introduction to data structures

1. 1. CS 211 Data Structures and Algorithms by Jayson G. Mauricio LECTURE 1: INTRODUCTION TO DATA STRUCTURESData Structure – is a way of organizing data that considers not only the itemsstored but also their relationship to each other.A general understanding of data structures is essential to developing efficientalgorithms in virtually all phases of advanced data processing and computer science.The ability to make right decisions is vital to anyone involved with computers. Suchdecisions typically involve the following general issues:- Efficiency of a program with respect to its run time. Does it perform its task in a time allotment that does not detract from overall system performance?- Efficiency of a program with respect to its utilization of main memory and secondary storage devices. Does it consume such resources in a fashion that makes it use impractical?Algorithm – is a clear and unambiguous specification of the steps needed to solve aproblem. - a step-by-step plan for solving a particular problem in a finite amountof time. - developed by simply thinking about how to come up with a solution forthe problem. From experiences, it’s just normally sitting down with pen and paperand start jotting down everything that comes to mind until it eventually end up witha semi-organized outline that can be converted into an algorithm. - may be expressed in either: ● Human language (English, Tagalog) ● Pseudocode - which is a cross between human language and a programming language - is a verbal description of the solution, involving a mixture of English and a programming language. Pseudo is a prefix meaning almost, relating to (pseudo – code : almost, relating to code). ● Graphical representation like a flowchart A flowchart is essentially the same as pseudocode except it is a visual tool that uses different chart symbols to direct flow of the program.Lecture 1: Introduction to Data Structures 1
2. 2. CS 211 Data Structures and Algorithms by Jayson G. MauricioEXAMPLES:PROBLEM: Create a program that will determine the number of times a name occursin a list.a. Human language:1. Get the list of names, lets call this nameList2. Get the name to look for, lets call this the keyname3. Compare the keyname to each of the names in nameList4. If the keyname is the same with a name in the list, add 1 to the count5. If all the names have been compared, output the resultb. Pseudocode Let nameList = List of Names Let keyName = the name to be sought Let Count = 0 For each name in NameList do the following if name == keyName Count = Count + 1 Display Countc. Flowchart Flowchart Symbols:Lecture 1: Introduction to Data Structures 2
3. 3. CS 211 Data Structures and Algorithms by Jayson G. Mauricio● NOTE:– These are just guidelines for commonly used symbols in creating flowcharts. Youcan use any symbols in creating your flowcharts, as long as you are consistent inusing them.Lecture 1: Introduction to Data Structures 3
4. 4. CS 211 Data Structures and Algorithms by Jayson G. MauricioExpressing our solution through FLOWCHART:Lecture 1: Introduction to Data Structures 4