CS18301
CS18301
CS18301
Code: 991278
1
Q. Code: 991278
10. (a) Let L1 and L2 be two linked lists that contain integers in sorted order. (16)
Implement a list L3 which should contain integers from L1 and L2 in sorted
order.
Implement a list L4 which forms the intersection of lists L1 and L2.
Input: L1: {12,15,16,18} , L2:{3,4,5,18,24}
Expected Output L3: {3,4,5,12,15,16,18,18,24} L4:{18}
(OR)
(b) Illustrate the operations on a Min-Heap-Insert on the Heap (16)
A={15,13,9,5,12,8,7,4,0,6,2,1}.
11. (a) Apply the operations of stack to convert the following infix expression to (16)
postfix expression with suitable code.
Infix Expression: a + b * c / d + e
(OR)
(b) Construct an AVL tree with the given set of key values: (16)
{12,45,32,6,8,34,2,8,65,77,99,100}. Perform necessary rotations.
12. (a) Illustrate the working of Dijkstra’s algorithm to find the shortest path from (16)
‘v1’ to all other vertices by considering the following graph :
(OR)
(b) Construct a minimum spanning tree using Prim’s and Kruskal’s algorithm (16)
for the following graph: