CSE225 Lecture01 Introduction To DS
CSE225 Lecture01 Introduction To DS
Algorithms
1
Data
Data can be defined as a representation of facts and concepts by
values.
Data is collection of raw facts.
2
Introduction to Data
Structures
One of the most fundamental courses in Computer
Science
4
So, what is a data
structure?
A data structure is a way to store and organize data in a
computer so that it can be used efficiently.
6
How do we study data
structures?
When we study data structures, we
study them in two ways:
Logical models (we look at an abstract
view of them or ADT)
Implementations of the ADT
Classification of Data Structure
Two broad categories of data structure are :
Primitive Data Structure
8
Primitive Data Structure
9
Non-Primitive Data Structure
10
Difference between
them
11
Classification of Data Structure
Data structure
Primitive DS Non-Primitive DS
12
Classification of Data Structure
Non-Primitive DS
Characterstic Description
Dynamic structures are those which expand or shrink depending upon the
Dynamic program need and its execution. Also, their associated memory locations
changes. Example: Linked List created using pointers 14
OPERATIONS
15
MAJOR OPERATION
Traversing: Accessing each record exactly once so that certain
items in the record may be processed [ Also known as Visiting
the record]
Searching: Finding the location of the record with a given key
value, or finding the locations of all record which satisfy
one or more conditions
Inserting : Adding a new record to the structure
Deleting : Removing a record from the structure
Sorting: Arranging a list in some logical order.
Merging: Combing two list in a single list.
16
Abstract Data Type
ADTs specify the type of data stored and the operations that
support the data
17
E.g. Operations of
Stack ADT
• Stack −
• isFull(), This is used to check whether stack is full or not
• isEmpty(), This is used to check whether stack is empty or
not
• push(x), This is used to push x into the stack
• pop(), This is used to delete one element from top of the
stack
• peek(), This is used to get the top most element of the stack
• size(), this function is used to get number of elements
present into the stack
18
ADT and Data
Structures
ADT is a high-level description: the logical picture of the data
and the operations that manipulate them while data structure is
concrete that is it is a collection of data elements and the
operations that store and retrieve individual elements.
19
Abstract Data Type