Beruflich Dokumente
Kultur Dokumente
The delete-min operation for Min-Max heaps and Deaps have the same asymptotic complexity O (log n ) . Which will run faster in practice? Why? How
about insert operation? (Hint: give the worst-case number of key comparisons). 4. 5. 6. Write the steps to be followed to decrease the key in node b. How will you calculate the Balance factor of an AVL tree? What is the maximum height of a bottom up splay tree that is created as the result of n insertions made into an initially empty splay tree? What is the use of Convex Hull? How is recursion used in Divide and Conquer strategy? Define Graph Coloring. List out the advantages of Dynamic Programming over greedy.
75
07
8. 9. 10.
7.
75
07
Answer ALL questions.
75
Maximum : 100 marks
20073
07
Devise a linked list representation for a list in which insertions and insert and delete at either end.
(ii)
Define the concept and advantages of a DOUBLY LINKED LIST with an example. Or (6)
(b)
(i)
Write a function that inverts an arbitrary non-recursive list l with no shared sublists. The sublists of l also are inverted. (8) (8)
(ii)
ababaa
abaabaabb a min
Consider
07
binomial heap with Or Or 2
(1)
aaaab
3,6,8,2,16,22,14,30,9,11. (ii)
75
algorithm. every insertion.
Meld the following min height biased leftist trees using the (6)
(b)
Explain, with example the basic heap operations and write algorithms for the same. (16)
13.
(a)
Insert the following elements in sequence into an initially empty 2-3 tree: 6, 3, 8, 1, 4, 5, 7, 2, 9. Delete the elements 11 and 14. Show the 2-3 tree after every insertion and deletion. (16)
07
(b)
(i)
75
75
following
07
(10) elements. (10)
20073
(ii)
Delete the element 2 from the below shown figure (double edge red-black tree.
14.
(a)
A greedy algorithm, just like an approximation algorithm, gives a nonoptimal solution to a problem. What is the difference between the two types of algorithm? Compute the time complexity of the both. Or (16)
(b)
Write a Pseudo code for Randomized Quick sort algorithm and compare its performance with iterative version of Quick sort. (16)
15.
(a)
Develop an algorithm for implementing 8 Queens Problem using BACKTRACKING method. (16)
(b)
75
Or 3
07
Give the optimal and approximate solutions for this problem. For the
75
07
75
(16)
07
(6)
20073