CS1151 Data Structures Nov Dec 2007 1
CS1151 Data Structures Nov Dec 2007 1
6 o
L.'
,\
J-
.v tt
H-3234
2007. NOVEMBER/DECEMBER DEGREEEXAMINATION, B.E.lB.Tech.
Third Semester Electronics and Communication Engineering
1.,
When will you say an algorithm efficient? Give the notations for time complexlty. What is answer. 'top-down design'? Is 'C' langUage a top-down design? Justify your
2,
3. 4. 5. 6. 7, 8. 9.
Why is linked list used for polynomial arithmetic? Write the role of stack in function call. What is the minimum number of nodesin an AVL tree of height 5? What is the use of sentinel value in binary heap? Which is the best way of choosingthe pivot element in quick sort? Merge sort is better than insertion sort. Why? Define a graph. How it differs from tree?
10. What is minimum spanningtree? Name any two algorithms used to find MST.
ww
w.
aa na
va
N.
co m
PARTB-(5x16=80marks) 11. (d (i) Given two lists L1 and L2, wriLe the routines to compuheL1' aL2 using basic operations. (Hint : for efficient performance, sort (10) the tists). Write the routines for inserting and deleting eiements from a (6) queue. Check for the conditions Q-empty and Q-Full. Or (b) (i) (ii) 12. (a) (i) How would you implement a stack of queues?write routines for (8) creation and inserting of elements into it. (8) data into the list. write routines to insert heterogeneous Write the routines to insert and remove a node from Binary Search (10) Tlee.
(ii)
N.
Or (b) (i)
co m
(ii)
A full node is a node with two children. Prove that the number of full nodes plus one is equal to the number of leavesin a binary tree. (6)
13.
(a)
Explain, with suitable examples the basic heap operations and write (16) algorithms for the same.
ww
(b)
How will you resolve the collisions, while inserting elements into the hash table using separate chaining and linear probing? Write the routines for inserting, searching and removing elements from the hash (16) table using the above mentioned techniques. Write the routine for sorting z elements in increasing order using (r2) heap sort. order using heap sort. Sort 3, !, 4, I, 5,9,2,6 in decreasing Or (4)
w.
aa na
(ii)
\Vrite the proceduresto implement single and double rotations (10) rvhile inserting nodesin an A\4, tree.
va
Or
S h o r vt h e r e s u l t o f i n s e r t i n g2 , 7 , 4 , 5 , 9 , 3 , 6 , A\L tree.
(b)
(i) (ii)
(6)
What is external sorting? Discuss the algorithms with proper (10) examples.
'd-3234
lb.
(a)
(i) (ii)
(6)
What is single source shortest path problem? Discuss Dijikstra's (10) single source shortest path algorithm with an example. Or
0d
(i)
Write an algorithm to find the minimum cost spanning tree of an (8) undirected, weighted Sraph. Find MST for the following graph. (8)
(ii)
ww
w.
aa na
va
N.
R 3234
co m