Sie sind auf Seite 1von 8

Data Structures & Algorithms

Dr Ravi Prakash Gorthi Aug-Dec, 2010

Data Structures & Algorithms


Topics Why Study DS & Algorithms? Abstract Data Types Arrays and Linked Lists Stacks & Queues Trees & Graphs Sorting and Searching Complexity of Algorithms

Data Structures & Algorithms


Text Books:
1. 2. Data structures and Algorithms in C by Mark Allen Weiss Fundamentals of Data Structures in C by E. Horowitz, S. Sahni, S. Anderson-Freed Data Structures and Algorithms by A. V. Aho, J. E. Hopcroft, and J. D. Ullman Introductions to algorithms by T.H Cormen, C.E. Leiserson, R.L Rivest, C. Stein Algorithm Design, Foundation Analysis and Internet Examples by Michael T. Goodrich, Roberto Tamassia The Art of Computer Programming: Sorting and searching, volume 3 by D. E. Knuth

Reference Books:
1. 2. 3. 4.

Data Structures & Algorithms


Evaluation: Type of Test Class Assignments (*) Surprise / Announced Quiz Mid-Term Final Exam Weightage 20% 20% 20% 40%

(*): To be submitted within 6 days after the class; evaluated for 10 marks if submitted within 6 days, for 7 if submitted between 6 to 10 days and NO marks after that; bonus marks if submitted within 3 days.

Data Types
Def: A data-type is a collection of homogeneous entities and a set of operations on these entities. E.g. Consider a data-type integer with the collection of integers: {int_min, int-min+1, . . . -1, 0, +1, 2, . . . Int_max} and the following set of operations: Binary operators: +, -, *, /; There are two categories of data-types: Built-in Data-types (char, integer, . . . ) Abstract Data types (stack, tree, . . . )

Abstract Data Types


Def: An Abstract Data Type (ADT) is a data-type, Which is a user-defined (not built-in or pre-defined) data-type which is organized in such a way that the specification of the entities, the operations on these entities is separated from the internal representation and implementation details.
Example:
A Stack
CreateAStack () Push (entity, A_Stack) Pop (entity, A_Stack)

Stack Stack and and Its Its Operations Operations

Whether the stack is implemented as an array or as a linked-list is NOT known to the main / other programs!!!

Abstract Data Types


Other Examples: ADT Tree
R S1 S11 S12 S2 S21 S22

CreateATree () AddSons (list, Parent, A_Tree)

Tree Tree and and Its Its Operations Operations

DeleteSon (entity, Parent, A_Tree) SearchTree (entity, Flag, A_Tree)

How the Tree is internally implemented is NOT knwn to the main / other programs; they only make use of the operations;

Assignments of Class # 2
1. 2. Come up with an ADT of your own choice, describe the ADT and the operations to be implemented on the ADT; Who is Edsger W Dijkstra? What are his main contributions to the field of Computer Programming (which is a part of Computer Science)?

Das könnte Ihnen auch gefallen