Professional Documents
Culture Documents
CMSG Ge2
CMSG Ge2
1. i. Write an algorithm to delete a node from the beginning of a doubly linked list? [3+2]
ii. What are the main differences between the Linked List and Linear Array?
2. i. Write an algorithm to insert a node to the end of a singly linked list? [3+2]
ii. Write an algorithm to count the number of nodes in a singly linked list?
5. i. There is a sorting method which checks if every two consecutive elements [4+2]
are in order. Name the method and use it to sort the given array a[5]={75, -2 0,
53, 32} in descending order.
ii. State the drawback of the linear search mechanism. How can it be overcome?
6. i. Write an algorithm to search for ‘x’ from a given array of integers arr[], using the [4+1]
binary search technique.
8. i. Distinguish between full and complete binary trees with proper examples. [2+3]
ii. The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23,
39, 35, 42. What is the postorder traversal sequence of the same tree?