You are on page 1of 17

Syllabus

 Introduction to Data Structures


 Algorithm and Complexity
 Array
 Stack
 Queue
 Linked List
 Graph and Tree

Ashish Gupta, Data Structures @ JUET, Guna


Recommended Books

TexT Books:
1. Seymour Lipschutz, “Data Structure”, Schaum’s Outlines, Tata McGraw Hill
2. Sartaj Sahni, “Data Structures, Algorithms”, Tata Mc Graw Hill, New York
3. Preiss, Bruno R., “Data Structures and Algorithms: With Object-Oriented Design Patterns
in C++ “, John Wiley & Sons, New York
4. R.S. Salaria, “Data structure and algorithms using C”
RefeRence Books:
1. Kruse, Tonso, Leung, “Data Structures and Program Design in C”
2. Langsam, Augestein, Tanenbaum, “Data Structures using C and C++”
3. Weiss, “Data Structures and Algorithm Analysis in C/C++”
4. Carrano and Prichard, “Data Abstraction and Problem solving with C++”
5. Corman at el, “Introduction to Algorithms”

Ashish Gupta, Data Structures @ JUET, Guna


Marks Distribution

Component & Duration Marks / Weightage


Nature
Test-1 1 hrs 15
Test-2 1 hrs 30 min. 25
Test-3 2 hrs 35
Tutorials 10
Attendance 05
Quiz & 10
Assignments
Total 100

Ashish Gupta, Data Structures @ JUET, Guna


Prerequisite Knowledge

1. Basic programming constructs from C programming like


data types, operators, decision control, loops, string and
functions etc.

2. Dynamic memory allocation

3. Pointers

Ashish Gupta, Data Structures @ JUET, Guna


Preface of Data structure

Data Structure ?
• In general, any representation of data which follow a structure is data structure.
• But by definition, data structure is a way of organizing the data in computer memory
which makes the basic operations on data more efficient.

Basic operation –
• Traversing – Accessing and processing record exactly once
• Insertion – Adding new record to data structure
• Deletion – Removing particular record from the data structure
• Searching – Finding the location of the record in data structure
Special operation –
• Sorting – Arranging the record in some specific order
• Merging – Combining the records from different data structures to single data structure

Ashish Gupta, Data Structures @ JUET, Guna


Efficiency

 An algorithm or program is said to be efficient if it solves a problem within provided


resources.
Generally, following two parameters are used to find out the efficiency of algorithm –
1. Space
2. Time

Therefore, we can say


More efficient Program = Less complex program

Complexity – Behavior of algorithm


1. Time Complexity: Behavior of algorithm over the time
2. Space Complexity: Behavior of algorithm over the memory space

Ashish Gupta, Data Structures @ JUET, Guna


Cost

Cost of data structure or algorithm is always calculated in terms of following


parameters –
1. Time Complexity: Time required to perform a basic operation on data
2. Space Complexity: Memory space required to store the data items of data
structure
3. Programming efforts to write code for basic operations.

Ashish Gupta, Data Structures @ JUET, Guna


Type of data structures

1. Array
2. Stack
3. Queue
4. Linked list
5. Tree
6. Graph
7. Heap etc.

Ashish Gupta, Data Structures @ JUET, Guna


Selection of data structure

 Organization of data in memory affects the performance of algorithm

 So, selection of data structure plays important role to make algorithm efficient
But, it depends on the nature of problem and operations to be supported.

Typically, following steps are to be followed to select an efficient data structure –


1. Analyze the problem very carefully and estimate the resources a solution must
meet.
2. Determine the basic operation to be supported
3. Select the best data structure which meets the above requirements.

Ashish Gupta, Data Structures @ JUET, Guna


Basic Mathematical Notations

Floor Function –
d denotes the greatest integer which does not exceed value of d and it is called
as floor of d.
Example: 2.4 = 2, 3.5 = 3, 3.9 = 3, -8.2 = -9 and 5 = 5 etc.
Ceiling Function –
d denotes the least integer which is not less the value of d and it is called as
ceiling of d.
Example: 2.4 = 3, 3.5 = 4, -8.2 = -8, and 5 = 5 etc.

Therefore, if d is integer then,

d = d ,

Otherwise d +1= d

Ashish Gupta, Data Structures @ JUET, Guna


Basic Mathematical Notations (Cont…)

 Let k be any integer and let M be a positive integer. Then,

r = k (mod M), r is remainder and 0 <= r < M,


Therefore, k = Mq + r, where q is quotient.

 Integer value of d is denoted by INT(d)


INT(3.2) = 3, INT(6.7) = 6, INT(-8.2) =-8

Ashish Gupta, Data Structures @ JUET, Guna


Data types (Recollect)

Ashish Gupta, Data Structures @ JUET, Guna


Data types (Cont…)

Abstract Data Type (ADT) –


A data type can be considered abstract when it is defined in terms of operations on
it, and its implementation is hidden.

Atomic Data Type –


Generally, data structure is represented by memory block which has two parts:
1. Data storage
2. Address storage

Data Address Data Address Data NULL

Ashish Gupta, Data Structures @ JUET, Guna


Data types vs. Data Structures

 A data type is a well-defined collection of data with a well-defined set of


operations on it. Examples – int, char, float, array etc.

 A data structure is an actual implementation of a particular ADT.

Ashish Gupta, Data Structures @ JUET, Guna


Summary

 Data structure overview


 Need of data structure and how to select relevant data structure
for given problem
 Basic C data types and ADT
 Comparison between data types and data structures

Ashish Gupta, Data Structures @ JUET, Guna

You might also like