Professional Documents
Culture Documents
6. Illustrate the operation of the algorithm INSERTION SORT on the set of numbers 5
S = {30, 12 13, 13, 44 12, 25, 13}. How many comparisons are performed by the
algorithm?
8. a) Convert the given infix notation to a prefix notation using stack 5+5=10
Expression: (A+B^C) *D+E^5
(^ is the highest precedence operator) State the rules.
b) Write a C program to evaluate the following input? 5 2 * 3 3 2 + * +
selection sort is used and array is already in the opposite order? Justify your answer.
10. a) Insert the keys 78, 52, 81, 40, 33, 90, 85,20 and 38 in a B-Tree with order 3 7+3=10
b) Compare B-Tree and B+ tree.
11. a) Consider a simple Hash function ‘Key mod 11’ and sequence of keys as 56, 700, 7+3=10
66, 12, 34, 47, 94, 78, 55 and 101. Assume that 10 free memory places are
available to store the records.
Explain the Open Addressing method with the given values to overcome the
collision.
b) State the disadvantage of this method.
12. Consider the following circular priority queue. 5+5=10
1 2 3 4 5
1| A
2|BC D
3| E F
4|I G H
Do the following operations and show the Front and Rear pointer values after each
operation.
i) insert J K L with priority 1 ii) delete 2 elements with priority 4
iii) insert M N O with priority 2 iv) insert P Q with priority 3
13. a) Write an algorithm to remove duplicate nodes (nodes with duplicate value) from 5+5=10
a sorted linked list.
b) Find out the DFS sequence for the following graph.