CS 8391 - Data Structures
CS 8391 - Data Structures
CS 8391 - Data Structures
4. Brief about the generalized version of Queue. And list the operations performed
by it.
11. a) i) Given two sorted Linked lists L1 and L2. Exemplify and write the
functions to compute L1 ∩ L2 and L1 ∪ L2. (10)
ii) State the advantages of Linked list over arrays. Specify any two real
time applications of Linked list. (3)
(OR)
12. a) What are circular queues ? Write an algorithm to insert an element and delete
an element from a circular queue. And list the applications of queue. (13)
(OR)
b) i) Write a C program to implement a LIFO list that grows and shrinks
dynamically. (7)
ii) Convert the following Infix expression to Postfix expression.
(4 + 8)* (6 – 5)/((3 – 2)* (2 + 2)) (3)
iii) Find the value of the following postfix expression. Show stack contents-step
by step output.
54 6 + 7 4 – * 9 / 35 15 + + (3)
13. a) i) Write C functions to perform deletion in Binary search tree (Include all
the cases). (5)
ii) Construct a binary search tree for the values 45, 56, 39, 12, 34, 32, 10,
78, 67, 89, 91. Give the pre order and post order traversal of the resultant
binary search tree. (6+2)
(OR)
b) Construct B tree to insert the following key elements with order 5.
2, 14, 12, 4, 22, 8, 16, 26, 20, 10, 38, 18, 36, 48, 6, 24, 28, 40, 42, 32 (13)
*X10312* -3- X 10312
ii) Find the Euler’s path and Euler’s circuit for the graph given below. (7)
(OR)
b) Consider the following graph, in what order will the nodes be visited using
Breadth first search and Depth first search, and give the routine for same. (13)
ii) Give the routine for Insertion sort. Sort the following sequence using
insertion sort 3, 10, 4, 2, 8, 6, 5, 1. (6)
b) Consider a hash table with 9 slots. The hash function is h(k) = k mod 9. The
following keys are inserted in the order 15, 38, 8, 5, 20, 33, 14, 30. Draw the
contents of the hash table when the collisions are resolved by
i) Chaining
iii) Double hashing. The second hash function h2(x) = 7 – (x mod 7). (13)
(OR)
_______________________