You are on page 1of 2

Q.

1 Write a program that reads the Name, Age and Salary of 10 persons and maintains them
in linked list sorted by Name.
Q.2 There are two linked lists A and B containing the following data: -
A: 2, 5, 9, 14, 15, 7, 20, 17, 30
B: 14, 2, 9, 13, 37, 8, 7, 28
Write programs to create: -
(a) A linked list C that contains only those elements that are common in both A and B.
(b) A linked list D which contains elements from both A and B, ensuring that there are
no repetition of element.
Q.3 Convert the expression (a+b)/(c-d) into postfix expression and then evaluate it for a=10,
b=20, c=15, d=5. Display the stack status for each operation.
Q.4 Write non-recursive version of the exponential algorithm Power (real x, integer n) where n
is a positive number. (Using stack and without using stack)
Q.5 Can a queue be represented by a circular linked list with only pointer pointing to the tail of
the queue? Write ‘C’ function for “add”, and “delete” operation on such a queue.
Q.6 What is a circular queue? Write a C program to print the elements of the queue in reverse
order.
Q.7 A binary tree has a preorder traversal of CABDIHKMEFGJLNO and an inorder traversal of
AIDBKHMCFEJNLOG. What is its postorder traversal?
Q.8 Use the remove algorithm to remove a node from the binary search tree shown below.
Draw the resulting tree for each.
(a) Remove node 65 from the original tree.
(b) Remove node 16 from the original tree.
(c) Remove node 12 from the original tree.
(d) Remove node 42 from the original tree.

Q.9

Q.10 Write an algorithm for:


(a) Merge Sort
(b) Radix Sort

You might also like