Professional Documents
Culture Documents
Write the algorithm to perform the insertion operation on a circular queue represented
in the form of an array.
2. Write a recursive function to calculate factorial of a number.
3. Write an algorithm to reverse all elements of a singly linked list.
9. Convert the following infix expression to postfix notation by showing the operator stack and
output string after reading each input token:
A+B*C-D/E*H
10. What do you mean by hashing? What is hash function? What is collision? How it is handled?
11. What is a priority queue?
12. Write the algorithm of Merge Sort and explain with an example.
13.Explain with a suitable example, the principal operation of Quick Sort.
14.Find the complexity of Quick Sort.
15. Why is the Queue Data Structure called FIFO?
16. In a two dimensional array 10X9 with each element occupying 4 bytes of memory with the
address of the first element [1, 1] is 1000.Find the address of [6, 8] for both Row-major and
Column-major cases.
17. How can a polynomial such as 10a5-3a3+6a2+9 be represented by a linked list?
18. Write down the overflow condition of circular queue.
19. Give an algorithm to search an element in an array using binary search.
20. If n0 be the total number of leaf nodes and n2 be the total number of nodes having two
children in a binary tree, then prove that n2 = n0 - 1.
21. Write an algorithm to insert an item in the beginning of a liked list.
22. Give an algorithm to search an element in an array using binary search.
23. The pre-order and in-order traversal sequence of nodes in a binary tree are given below:
Preorder :ABDGHEICFJK
Inorder :GDHBEIACJFK
Draw a binary tree. Briefly state the logic to construct the tree.