You are on page 1of 12

KCS301: DATA STRUCTURES

Unit - I
Introduction: Basic Terminology, Elementary Data Organization, Algorithm, Efficiency of an Algorithm, Time and
Space Complexity, Asymptotic notations: Big-Oh, Time-Space trade-off, Abstract Data Types (ADT),
Arrays: Definition, Single and Multidimensional Arrays, Representation of Arrays: Row Major Order, and Column
Major Order, Application of arrays, Sparse Matrices and their representations.
Linked lists: Array Implementation and Dynamic Implementation of Singly Linked Lists, Doubly Linked List, Circularly
Linked List, Operations on a Linked List. Insertion, Deletion, Traversal, Polynomial Representation and Addition,
Generalized Linked List .
Unit – II
Stacks: Abstract Data Type, Primitive Stack operations: Push & Pop, Array and Linked Implementation of Stack in C,
Application of stack: Prefix and Postfix Expressions, Evaluation of postfix expression, Recursion, Tower of Hanoi
Problem, Simulating Recursion, Principles of recursion, Tail recursion, Removal of recursion
Queues: Operations on Queue: Create, Add, Delete, Full and Empty, Circular queues, Array and linked implementation
of queues in C, Dequeue and Priority Queue.
Unit – III
Searching: Concept of Searching, Sequential search, Index Sequential Search, Binary Search. Concept of
Hashing & Collision resolution Techniques used in Hashing. Sorting: Insertion Sort, Selection, Bubble Sort,
Quick Sort, Merge Sort, Heap Sort and Radix Sort.
Unit – IV
Graphs: Terminology, Sequential and linked Representations of Graphs: Adjacency Matrices, Adjacency List, Adjacency
Multi list, Graph Traversal : Depth First Search and Breadth First Search, Connected Component, Spanning Trees,
Minimum Cost Spanning Trees: Prims and Kruskal algorithm. Transitive Closure and Shortest Path algorithm: Warshal
Algorithm and Dijikstra Algorithm, Introduction to Activity Networks
Unit – V
Trees: Basic terminology used with Tree, Binary Trees, Binary Tree Representation: Array Representation and
Pointer(Linked List) Representation, Binary Search Tree, Strictly Binary Tree ,Complete Binary Tree . A
Extended Binary Trees, Tree Traversal algorithms: Inorder, Preorder and Postorder, Constructing Binary Tree
from given Tree Traversal, Operation of Insertation , Deletion, Searching & Modification of data in Binary
Search . Threaded Binary trees, Traversing Threaded Binary trees. Huffman coding using Binary Tree. Concept
& Basic Operations for AVL Tree , B Tree & Binary Heaps
References:
1. Aaron M. Tenenbaum, Yedidyah Langsam and Moshe J. Augenstein, “Data Structures Using C and C++”, PHI
Learning Private Limited, Delhi India
2. Horowitz and Sahani, “Fundamentals of Data Structures”, Galgotia Publications Pvt Ltd Delhi India.
3. Lipschutz, “Data Structures” Schaum’s Outline Series, Tata McGraw-hill Education (India) Pvt. Ltd.
4. Thareja, “Data Structure Using C” Oxford Higher Education.
5. A. K. Sharma, “Data Structure Using C”, Pearson Education India.
6. Rajesh K. Shukla, “Data Structure Using C and C++” Wiley Dreamtech Publication.
7. Michael T. Goodrich, Roberto Tamassia, David M. Mount “Data Structures and Algorithms in C++”, Wiley India.
8. P. S. Deshpandey, “C and Data structure”, Wiley Dreamtech Publication.
9. R. Kruse etal, “Data Structures and Program Design in C ”, Pearson Education
10. Berztiss, A. T.: Data structures, Theory and Practice:, Academic Press.
11. Jean Paul Trembley and Paul G. Sorenson, “An Introduction to Data Structures with applications”, McGraw Hill.
12. Adam Drozdek “ Data Structures and Algorithm in Java”, Cengage Learning

COURSE PLAN
DATA STRUCTURES
KCS301

Course Description: Data structure is a subject of primary importance to the discipline of Computer Science.
Organizing of structuring data is vital to the design and implementation of efficient algorithms and program
development. This course is designed to help the students to gain an understanding of Data Structures Linear as well as
non Linear.
PRE-Requisite: Student must have basic knowledge of computer operation, input, output devices some mathematical
concepts such as basic mathematical formulas. Fibonacci series, Armstrong number, HCF, LCF, GCD of numbers and
concept about matrix and an understanding of the ‘C’ programming language.

PAGE
UNIT TOPICS HR. TEXT BOOK REFERRED
NO.
1. Basic Terminology : Data ,Data Item, Seymour Lipschutz, Data
Entity Set, Record , File, Key, 1 Structures, Schaum’s Outline 1.1
Information Series, TMH
2. Elementary Data organization :
Seymour Lipschutz, Data
Concept of Data Type, Definition Of 1.3-1.9,
1 Structures, Schaum’s Outline
Data structure, Primitive Data Type, 2.20
Series, TMH
Abstract Data Type
3. Description of various Data Seymour Lipschutz, Data
Structure: Linear Arrays, Linked list, 1 Structures, Schaum’s Outline 1.3-1.9
Stacks, Queues Series, TMH
4. Description of various Data Seymour Lipschutz, Data
Structure: Trees, Heaps, Graphs, One 1 Structures, Schaum’s Outline 1.3-1.9
& two dimensional Arrays, Linked Lists Series, TMH
5. Algorithm Complexity and Time
Seymour Lipschutz, Data
Space Trade off: Space Complexity,
1 Structures, Schaum’s Outline 2.14-2.17
Time Complexity, Time, Space Trade
Series, TMH
Off.
Seymour Lipschutz, Data
1 6. Asymptotic notations: asymptotic
1 Structures, Schaum’s Outline 2.17
notations, Big Oh Notation.
Series, TMH
7. Arrays: Array Definition, Seymour Lipschutz, Data
Representation and analysis, Single and 1 Structures, Schaum’s Outline 4.1-4.18
multidimensional Array Series, TMH
Seymour Lipschutz, Data
8. Arrays: Address Calculation,
1 Structures, Schaum’s Outline 4.18-4.37
Operations on Arrays, Sparse Matrix
Series, TMH
Seymour Lipschutz, Data
9. Linked lists: Representation &
1 Structures, Schaum’s Outline 5.1-5.8
implementation of singly linked lists.
Series, TMH
Seymour Lipschutz, Data
10. Doubly Linked List: 1 Structures, Schaum’s Outline 5.35
Series, TMH
11. Applications Of Linked Lists :
Seymour Lipschutz, Data
Addition of Polynomials, Multiplication
1 Structures, Schaum’s Outline 5.31-5.51
of Polynomials,
Series, TMH
Representing Sparse Matrix.
2 Seymour Lipschutz, Data
1.Stack : Primitive Stack operations,
1 Structures, Schaum’s Outline 6.1
Push and pop
Series, TMH
2.Implementation of stack: Static and Seymour Lipschutz, Data
dynamic implementation, Creation, 1 Structures, Schaum’s Outline 6.2-6.7
insertion deletion. Series, TMH
3.Applications of stack : Infix, postfix 1 Seymour Lipschutz, Data 6.9-6.14
PAGE
UNIT TOPICS HR. TEXT BOOK REFERRED
NO.
representation of expression, Evaluation Structures, Schaum’s Outline
and conversion of various expression Series, TMH
4.Recursion : Principles of recursion, Seymour Lipschutz, Data
Types of recursion, removal of 1 Structures, Schaum’s Outline 6.18
recursion ,tail recursion Series, TMH
Seymour Lipschutz, Data
5.Tower of Hanoi problem : simulation 1 Structures, Schaum’s Outline 6.22
Series, TMH
6.Queues: Operations on queue, Seymour Lipschutz, Data
Insertion, deletion, checking empty and 1 Structures, Schaum’s Outline 6.32
full queue Series, TMH
7.Types of queue Circular, linear, Seymour Lipschutz, Data
dequeue, priority queue 1 Structures, Schaum’s Outline 6.36
Series, TMH
8. Static(Array) implementation of Seymour Lipschutz, Data
queue : Insertion, deletion, empty ,full 1 Structures, Schaum’s Outline 6.39
check Series, TMH
9. Dynamic (Linked) list Seymour Lipschutz, Data
implementation of queue : Insertion, 1 Structures, Schaum’s Outline 6.40
deletion, empty ,full check Series, TMH
Seymour Lipschutz, Data
1. Searching : Concept of Searching
1 Structures, Schaum’s Outline 9.18
Series, TMH
Seymour Lipschutz, Data
2.Searching: Sequential Search, Index
1 Structures, Schaum’s Outline 9.18
searching
Series, TMH
Seymour Lipschutz, Data
3. Searching :Binary Search 1 Structures, Schaum’s Outline 9.18
3 Series, TMH
Seymour Lipschutz, Data
4.Hashing:Concept of Hashing 1 Structures, Schaum’s Outline 9.2
Series, TMH
Seymour Lipschutz, Data
5.Hashing: Collision resolution
1 Structures, Schaum’s Outline 9.2
Techniques used in Hashing
Series, TMH
Seymour Lipschutz, Data
6. Sorting Insertion Sort, bubble sort 1 Structures, Schaum’s Outline 9.8
Series, TMH
Seymour Lipschutz, Data
7. Sorting techniques : Selection Sort,
1 Structures, Schaum’s Outline 9.8-9.9
Quick Sort
Series, TMH
Seymour Lipschutz, Data
8. Sorting techniques :Merge sort 1 Structures, Schaum’s Outline 9.9-9.10
Series, TMH
Seymour Lipschutz, Data
9. Sorting techniques : Heap Sort,
1 Structures, Schaum’s Outline 9.10-9.11
radix sort
Series, TMH
4 Seymour Lipschutz, Data
1.Graph terminology: Various terms
1 Structures, Schaum’s Outline 8.1
related to the graphs.
Series, TMH
2.Graph representations : Sequential 1 Seymour Lipschutz, Data 8.5
& Linked representation, Adjacency Structures, Schaum’s Outline
Matrix Representation Of the Graph, Series, TMH
Adjacency List representation of the
PAGE
UNIT TOPICS HR. TEXT BOOK REFERRED
NO.
graph
3.Graph Traversal : Breadth First Seymour Lipschutz, Data
Search, Depth First Search, Strongly 1 Structures, Schaum’s Outline 8.21
Connected Component Series, TMH
4.Application Of Graphs : Minimum Seymour Lipschutz, Data
cost spanning tree, Prim’s & Kruskal 1 Structures, Schaum’s Outline 8.7
Algorithm Series, TMH
5.Shortest Path Algorithms: Seymour Lipschutz, Data
Warshall’s Algorithm, Dijkstra 1 Structures, Schaum’s Outline 8.8
Algorithm Series, TMH
1.Tree: Basic terminology, binary tree, Seymour Lipschutz, Data
root node, child node, degree of a 1 Structures, Schaum’s Outline 7.1 – 7.7
node. Series, TMH
2.Binary tree: Binary tree Seymour Lipschutz, Data
Representation, Binary tree 1 Structures, Schaum’s Outline 7.12
implementation. Series, TMH
3.Types of binary tree Rooted Trees, Seymour Lipschutz, Data
Ordered Trees, Position Trees, Complete 1 Structures, Schaum’s Outline 7.5-7.35
Binary Trees, Extended Binary Trees Series, TMH
4. Algebraic Expression Prefix, infix,
Seymour Lipschutz, Data
postfix Expression , representing the
1 Structures, Schaum’s Outline 6.9
algebraic expression with the
Series, TMH
help of Tree
5. Traversing Binary Trees Pre Order
Traversal Of a Binary Search Tree, In Seymour Lipschutz, Data
5
Order Traversal Of a Binary Search 1 Structures, Schaum’s Outline 7.9
Tree, Post Order Traversal of a Binary Series, TMH
Search Tree
6.Operations on Binary Search Tree
Determining Height of a Binary Search Seymour Lipschutz, Data
Tree, Determining Number of Structures, Schaum’s Outline
1 7.24
Nodes/Elements, Determining Number Series, TMH
of Internal Nodes, Inserting a new
element, Searching an element
7. Threaded Binary Trees Representing Seymour Lipschutz, Data
a Threaded Binary Tree in Memory, 1 Structures, Schaum’s Outline 7.46
Traversing threaded Binary tree Series, TMH
Seymour Lipschutz, Data
8. Tree Applications : Huffman Coding 1 Structures, Schaum’s Outline 67
Series, TMH

Reference Books:
 Seymour Lipschutz, Data Structures, Schaum’s Outline Series, TMH
 Yashwant Kanetkar, Data Structures through C, BPB Publications
 Reema Thareja,Data Structures Using C,Oxford University Press
 G A V Pai, “Data Structures and Algorithms”, TMH
 Horowitz and Sahani, “Fundamentals of Data Structures”, Galgotia Publication
TUTORIAL SHEETS
DATA STRUCTURES
KCS301

NOTE: Every Student must submit each Tutorial Sheet within Three Days of completion of The Unit Related to
the Sheet for its Evaluation. Each tutorial sheet is of 10 marks.

TUTORIAL SHEET 1

1. Explain the terms data, record, file and information?


2. Discuss about a Data Type? Explain its different categories.(UPTU 2011-12)
3. Discuss about algorithm complexity? Discuss about the need of measuring the complexity of an algorithm? (UPTU
2012-13)
4. Which of the following data structure is linear type? (Gate 2004)
Option A: Strings
Option B: Lists
Option C: Queues
Option D :All of the above

5.The time complexity of an efficient algorithm to find the longest monotonically increasing subsequence of n numbers is
(Gate)
Option A: O(n)
Option B: O(n Ig n)
Option C: O(n*n)
Option D: None of the above

TUTORIAL SHEET 2

1. Discuss about an array? What are different types of arrays? (UPTU 2012-13)
2. How a linear array is represented in memory? Give example. (UPTU 2013-14)
3. How a two dimensional array is represented in memory? Give example.
4. Let T(n) be the function defined by T(n) = 1 and T(n) = 2T (n/2) + n, which of the following is TRUE ?
Option A: T(n) = O( n*n*n), Option B: T(n) = O( log2n) Option C: T(n) = O( n) , Option D: T(n) = O( n*n)
(Gate)
5.The efficient data structure to insert/delete a number in a stored set of numbers is (Gate)
Option A: Queue
Option B: Linked List
Option C: Doubly Linked List
Option D:Binary Tree

TUTORIAL SHEET 3

1.Given the following arithmetic expression in infix notation as 12/(7-3)+2*(3+8)-7 Translate this expression into postfix
notation and then evaluate it using tabular method..(AKTU 2015-16)
2. What do you mean by recursion? Implement Tower of Hanoi with four disks.Draw tree Diagram with stack contents.
(UPTU 2014-15)
3. How peek() operation differs from pop() operation. Explain with Example.
Gate Questions:
4.Given an empty stack, after performing push (1), push (2), Pop, push (3), push (4), Pop, Pop, push(5), Pop, what is the
value of the top of the stack ? (Gate)
Option A: 4, Option B: 3 Option C: 2 , Option D: 1
5. Which of the following permutations can be obtained in the output using a stack of size 3 elements assuming that input,
sequence is 1, 2, 3, 4, 5 ? (Gate)

Option A: 3, 2, 1, 5, 4, Option B: 5, 4, 3, 2, 1 Option C: 3, 4, 5, 2, 1 , Option D: 3, 4, 5, 1, 2

TUTORIAL SHEET 4

1. Discuss about a queue? Is queue a linear or non linear data structure? Explain with Example. (UPTU2014-15)
2. How can we implement a queue in C with Insert and delete operations? Explain with Example. Show dry run .(UPTU
2010-11)
3. Explain the term Dequeue in detail.
4. Explain the term Priority Queue in detail. (Gate)
Consider the following statements for priority queue : S1 : It is a data structure in which the intrinsic ordering of the
elements does determine the result of its basic operations. S2 : The elements of a priority queue may be complex
structures that are ordered on one or several fields. Which of the following is correct?
Option A: Both S1 and S2 are incorrect., Option B: S1 is correct and S2 is incorrect.
Option C: S1 is incorrect and S2 is correct Option D: Both S1 and S2 are correct
5. . Give the name of the Linear list in which elements can be added at ends but not in the middle: (Gate)
Option A: Array., Option B: Queue., Option C: Tree , Option D: Circular Queue

TUTORIAL SHEET 5

1. WAP to create a linked list, with all conditions. Explain how nodes can be created dynamically in a linked list .(AKTU
2015-16)
2. WAP for the Polynomial addition and explain with example.
3. How can a node be inserted in the beginning of a linear linked list. Explain the steps with all possibilities.(UPTU 2012-
13)
4. To represent hierarchical relationship between elements, which data structure is suitable? (Gate)
Option A: Dequeue, Option B: Priority Option C: Tree, Option D: All of the above

5. .The min. number of nodes in a binary tree of depth d (root at level 0) is(Gate)
Option A: 2d – 1, Option B: 2d Option C: d+1 , Option D: d

TUTORIAL SHEET 6

1. Discuss about tree data structure. Explain different types of binary trees.
2. Define the Huffmans algorithm related to tree with an example and its use.? (AKTU 2015-16)
3. Draw the binary trees for the different Algebraic expressions. Take five different examples and also find their preorder
traversal.(UPTU 2008-09)

4.Consider the In-order and Post-order traversals of a tree as given below : In-order : j e n k o p b f a c l g m d h i Post-
order : j n o p k e f b c l m g h i d a The Pre-order traversal of the tree shall be (Gate)

Option A: a b f e j k n o p c d g l m h i
Option B: a b c d e f j k n o p g l m h i
Option C: a b e j k n o p f c d g l m h i
Option D: j e n o p k f b c l m g h i d a

5.The post order traversal of a binary tree is DEBFCA. Find out the preorder traversal (Gate)
Option A: ABFCDEi
Option B: ADBFEC
Option C: ABDECF
Option D: None of the above

TUTORIAL SHEET 7

1. Discuss about a graph? Explain with examples. Is graph a linear or non linear data structure? (UPTU 2014-15)
2 Discuss about Depth First Search? Explain with a suitable example.
3. Explain Minimum Cost spanning tree. Take an example and solve it with Prim’s and Kruskal’s Algorithm ?(AKTU
2015-16)
4. Consider an undirected graph G with 100 nodes. The maximum number of edges to be included in G so that the graph
is not connected is (Gate)
Option A: 2451
Option B: 4950
Option C: 4851
Option D: 9900

5. A simple graph G with n − vertices is connected if the graph has (Gate)


Option A: (n − 1) (n − 2)/2 edges
Option B: more than (n − 1) (n − 2)/2 edges
Option C: less than (n − 1) (n − 2)/2 edges
Option D: ∑ k(i=1) C(ni, 2) edges

TUTORIAL SHEET 8

1.Explain Activity Network. With an Example.(UPTU 2013-14)


2.Explain the Adjacency Matrix representation with an example of graph.(UPTU 2013-14)
3. Explain Dijkstra Algorithm.
4. Consider a weighted undirected graph with positive edge weights and let (u, v) be an edge in the graph. It is known that
the shortest path from source vertex s to u has weight 53 and shortest path from s to v has weight 65. Which statement is
always true? (Gate)
Option A: Weight (u, v) < 12 Option B: Weight (u, v) = 12
Option C: Weight (u, v) > 12 Option D: None of the above
5.Consider the following statements : (i) A graph in which there is a unique path between every pair of vertices is a tree.
(ii) A connected graph with e = v − 1 is a tree. (iii) A graph with e = v − 1 that has no circuit is a tree. Which of the above
statements is/are true ? (Gate)
Option A: (i) & (iii) Option B: (ii) & (iii) Option C: (i) & (ii) Option D: All of the above

TUTORIAL SHEET 9

1. Explain the Sequential search with an example.(UPTU 2008-09)


2. Explain the Binary search with an example.(AKTU 2015-16)
3. Give the steps for Selection Sort. Sort the list 32, 17, 57,14,9,23,7,41,5 using this method.
4.Linked Lists are not suitable for _____. (Gate)
Option A: Binary Search
Option B: Polynomial Manipulation
Option C: Insertion
Option D: Radix Sort

5. A binary search tree is a binary tree : (Gate)


Option A: All items in the left sub tree are less than root
Option B: All items in the right sub tree are greater than or equal to the root
Option C: Each sub tree is itself a binary search tree
Option D: All of the above

TUTORIAL SHEET 10

1. Give the steps for Quick Sort. Sort the list 32, 17, 57,14,9,23,7,41,5 using this method.
2. Give the steps for radix sort. Sort the list 32, 17, 57,14,9,23,7,41,5 using this method.
3. Discuss about an AVL tree? Explain the details of AVL tree.(UPTU 2013-14)
4. Explain the Heap Sort with an example.(UPTU 2011-12)
5. In which tree, for every node the height of its left sub tree and right sub tree differ almost by one ? (Gate)
Option A: Binary search tree
Option B: AVL tree
Option C: Threaded Binary Tree
Option D: Complete Binary Tree

MODEL PAPER
(SEM. III) ODD SEMESTER EXAMINATION 2019-20
DATA STRUCTURES
Time 3 Hours Total Marks 70
Note: Attempt all sections. If requires any missing data; then choose suitably

1. Attempt all questions in brief. 2x7=14


a) Differentiate Data Structure and Data Type.
b) What do you mean by Tail recursion?
c) What is Compaction?
d) Write the basic concept of KRUSKAL’s algorithm.
e) Write over flow conditions for a circular queue.
f) Describe the space and time complexities of a program are necessary.
g) Obtain an addressing formula for the element A[i 1][i2]….[in] in an n-dimensional array declared as A[u1]
[u2]….[un], Assume a column major representation of the array with one word per element.
2. Attempt any three of the following. 7x3=21
a) Write a function in C which searches string X for the first occurrence of string Y. If Y does not appear in
X, then function returns zero. Otherwise function returns starting position in X of the first occurrence of
Y.
b) Write an algorithm for evaluating an expression in postfix form.
c) State the Towers of Hanoi problem. Write a recursive algorithm for solving this problem when the
numbers of disk are three.
d) If the in-order traversal of a binary tree is B,I,D,A,C,Q,E,H,F and its postorder traversal is
I,D,B,Q,C,H,F,E,A, determine the binary tree.
e) Write a program in C for binary search. What is the worst case time complexity of binary search?
3. Attempt any one part of the following. 7x1=7
a) Write an algorithm to add two polynomials when the polynomials are represented using singly linked
lists. 
b) Illustrate the quick sort algorithm on list 9,20,12,21,3,5,1,22,19,7.
4. Attempt any one part of the following. 7x1=7
a) Discuss the different cases of rotations in AVL trees.
b) Use Prim’s algorithm to determine the minimum spanning tree of the graph given below:
5. Attempt any one part of the following. 7x1=7
a) Explain Dijkstra’s Algorithm and illustrate it on a suitable graph.
b) Implement typical stack operation when stacks are represented using singly linked lists.
6. Attempt any one part of the following. 7x1=7
a) Write an algorithm to insert and delete a node from doubly linked list.
b) Write an algorithm to convert a valid arithmetic infix expression into its equivalent postfix expression. Trace
your algorithm for A-B/C+D*E+F.
7. Attempt any one part of the following. 7x1=7
a) State the merits and demerits of static and dynamic memory allocation techniques.
b) Write short notes on any two :
(i)  Direct file organization
(ii)  Priority Queue
(iii)  Indexing.

You might also like