Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Structures and Algorithms Lecture-1: Introduction

Similar presentations


Presentation on theme: "Data Structures and Algorithms Lecture-1: Introduction"— Presentation transcript:

1 Data Structures and Algorithms Lecture-1: Introduction

2 Books Data Structures and Algorithms
By A. V. Aho, J. E. Hopcroft, J. D. Ullman Introductions to algorithms by Thomas H.Cormen, Leiserson, Rivest and Stein. Data Structures Using C and C++ By Y. Langsam, M. J. Augenstein, A. M. Tenenbaum Schaum's Outline Series, Theory and problems of Data Structures By Seymour Lipschutz

3 Guidelines Start working on projects/homeworks from first day.
Remain attentive during the class. Do not sleep and ask questions. I will ask questions very often

4 Dishonesty, Cheating in Quizzes, Assignments & Projects
Copying material in any form (code or otherwise) is not allowed. This will still be cheating even if you try to substitute or restructure words, structures, paras. You can always discuss ways to solve problem with your colleagues however you should not copy code. Penalty can be a zero in that and one other assignment on to a penalty of an F in the course.

5 Late assignments To cater for emergencies however, everyone gets 3 late days. The concept is that you can use these at your discretion any time during this course for regular assignments (not for project).

6 Course Contents Introduction Complexity Analysis
Simple Data Types and Abstract Data Types Arrays and Lists Elementary Data Structures Stack and Queues Recursion and Time Complexity of Recursive Algorithms Trees and Graphs Set structure Searching techniques Hashing Sorting techniques

7 What is a data structure exactly?

8 To answer that, we must first understand:
What is a computer program? Some mysterious processing Output Input

9 How to solve the following problems:
1. Input 3 numbers, print out the maximum. 2. Input numbers, print out the largest 10 numbers. 3. The Tower of Hanoi Problem. Condition: A larger one can not be on top of a smaller one.

10 Data structures let the input and output be represented
in a way that can be handled efficiently and effectively. array Linked list queue tree stack

11 Some mysterious processing Output Input Data structures + Algorithms = Programs

12 3 Steps in the Study of Data Structures
Logical or mathematical description of the structure Implementation of the structure on the computer Quantitative analysis of the structure, which includes determining the amount of memory needed to store the structure and the time required to process the structure

13 Data may be organized in many ways
E.g., arrays, linked lists, trees etc. The choice of particular data model depends on two consideration: It must be rich enough in structure to mirror the actual relationships of data in the real world The structure should be simple enough that one can effectively process the data when necessary

14 Arrays 1 Ali 2 Salam 3 Usman 4 Danial 5 Saeed 6 Zaka Linear Arrays

15 Arrays Customer Salesperson 1 Jamal Tony 2 Sana 3 Saeed Nadia 4 Farooq
Owais 5 Salman 6 Danial

16 Linked Lists Customer Salesperson 1 Jamal Tony 2 Sana Nadia 3 Saeed
Owais 4 Farooq 5 Salman 6

17 Trees Employee Age Address Salary Name First N Last N Street Area City
Province Post Code

18 Trees (2x+y)(a-7b)3 * + ^ - 3 * y a * 2 x 7 b

19 Stacks 2132 123 546 45 543 3 2544 IN OUT

20 Queue 2132 123 3 2544 33 IN OUT

21 The Need for Data Structures
Goal: to organize data Criteria: to facilitate efficient storage of data retrieval of data manipulation of data Design Issue: select and design appropriate data types. (This is the real essence of OOP.)

22 Data Structure Operations
Traversing Searching Insertion Deletion Sorting Merging


Download ppt "Data Structures and Algorithms Lecture-1: Introduction"

Similar presentations


Ads by Google