Unit 1 Introduction To Data Structure
Unit 1 Introduction To Data Structure
Unit 1 Introduction To Data Structure
Data Structure
Contact Hours/Week: 3L
Course Credits: 03
Course Objectives
To impart knowledge about linear and non-linear data structures as the
foundational base for computer solutions to problems.
To introduce the fundamental concepts relevant to binary trees, binary tree
traversals, binary search trees and perform related analysis to solve problems.
To enable the students to understand various types of sorting algorithms.
Syllabus
Unit Course Content Lectures
Number
UNIT-01 Introduction: Data types, data structures, abstract data types, the running time of 07L
a program, the running time and storage cost of algorithms, complexity,
asymptotic complexity, big O notation, obtaining the complexity of an algorithm.
UNIT-02 Development of Algorithms: Notations and Analysis, Storage structures for 10L
arrays - sparse matrices - structures and arrays of structures, Stacks and Queues:
Representations, implementations and applications. Linked Lists: Singly linked
lists, Linked stacks and queues, operations on Polynomials, Doubly Linked Lists,
Circularly Linked Lists, Operations on linked lists.
UNIT-03 Trees: Basic terminology, General Trees, Binary Trees, Tree Traversing: in-order, 07L
pre-order and post-order traversal, building a binary search tree, Operations on
Binary Trees.
UNIT-04 Graphs: Basic definitions, representations of directed and undirected graphs, the 06L
single-source shortest path problem, the all-pair shortest path problem, traversals
of directed and undirected graphs, directed acyclic graphs, strong components,
minimum cost spanning tress, articulation points and bi-connected components,
graph matching.
UNIT-05 Sorting and Searching Techniques: Bubble sorting, Insertion sort, Selection 06L
sort, Shell sort, Merge sort, Heap and Heap sort, Quick sort, Sequential searching,
Binary Searching, Index searching, Hash table methods.
Syllabus
Course Outcomes
Upon successful completion of the course, the students will be able to
CO1: Interpret and compute asymptotic notations of an algorithm to analyze the time complexity.
CO2: Use of linear and non-linear data structures as the foundational base for computer solutions
to problems.
CO3: Demonstrate the ability to implement various types of static and dynamic lists.
CO4: Implement binary trees, binary tree traversals, and binary search trees and perform related
analysis to solve problems.
CO5: Implement various types of sorting algorithms.
• Traversing
• Searching
• Insertion
• Deletion
• Sorting
• Merging
Types of Data Structure
1. Linear Data Structure
• Elements are stored sequentially
• We can traverse either forward or backward
• Examples: Arrays, Stacks, Queues, Linked list
2. Nonlinear Data Structure
• Not stored in sequential order
• Branches to more than one node
• Can’t be traversed in a single run
• Examples: Tree, Graphs
Types of Data Structure
Types of Data Structure
1. Arrays
• An array is a data structure consisting of a
collection of similar data elements, each identified
by one array index.
• The elements in array are stored in consecutive
memory locations.
Arrays
• Array Syntax:
int Age[10];
• Limitations of Arrays:
• Fixed size
• Data elements are stored in continuous memory
locations which may not be available, always
• Adding and removing of elements is tough because
of shifting the elements from their positions
Types of Data Structure
2. Linked List
• Consisting of a group of nodes which together
represent a sequence.
Then one would insert his or her record into the file.
Then one would delete his or her record from the file.
EXAMPLES & REAL LIFE APPLICATIONS
clrscr();
printf("Before function call x=%d \n", x);
change(&x);//passing reference in function
printf("After function call x=%d \n", x);
getch();
return 0; }
Differences between call by value and
call by reference
S. No. Call by value Call by reference