Data Structure Final Question
Data Structure Final Question
1. (a) What is data structure? What are the difference between linear and non-liner 1+2
data structure?
(b) What do you mean by complexity of an algorithm? What are meant by best 3
case, worst case and average case complexity? What are the complexity of
binary search algorithm?
(c) Explain Bubble sort algorithm with suitable example. 4
2. (a) What is Two-way Linked List? Write down benefits of using a Two-way 1+1
Linked List.
(b) What is Postfix Notion? Consider you have an equation Q: = 5 – 12 / 4 + (6 1+2
+ 2) written in Infix Notation, what should be its equivalent Postfix Notion.
(c) Considering the earlier Postfix Notion of the equation, write an Algorithm 5
that can evaluate the equation.
3. (a) What is recursive procedure? How to implement Towers of Hanoi using 1+3
recursion.
(b) What is a Binary Search Tree (BST)? 2
60
25 75
15 50 66
33
44
(i) Delete a node with value 44
(ii) After performing (i) insert a node with value 35.
4. (a) What is min and max heap? Draw the min heap that results from inserting: 1+3
2 8 6 1 10 15 3 12 11 in that order into an initially empty min heap. You are
required to show the final min heap along with intermediate heaps.
You are required to show the final minimum cost spanning tree along with
intermediate stages.