14 Marks Imp Questions
14 Marks Imp Questions
UNIT-1
1. a) Explain about different notations for time complexity and space complexity of
algorithms.[7M]
b) Write a C program to traverse an array in reverse order. [7M]
UNIT-2
1. a) Discuss the role of stacks in executing recursive procedures. [7M]
b) What is a priority queue? Explain different methods of implementing them. [7M]
2. a) Show the detailed contents of stack to evaluate the given postfix expression:
{1 2 3 + * 3 2 1 – + *}.[7M]
b) Write an algorithm to find factorial of a given number using recursion.[7M]
3. a) Write an algorithm/program that gives solution for Towers of Hanoi problem with n
disks.[7M]
b) With array representation, explain the basic queue operations.[7M]
4. a) Explain how postfix expressions are evaluated using stacks. Give an example. [7M]
b) Differentiate between regular queues and circular queues with insert and delete
operations.[7M]\
5. a) Explain how an infix expression can be converted into postfix expression, using
stacks. Give an example.[7M]
b) Write and explain the queue ADT. [7M]
6. a) Perform enqueue and dequeue operations in a queue. How do they differ from
circular queue operations? Explain.[7M]
b) Evaluate following expression. Write program to evaluate postfix expressions.
i) 10+3-2-8/2*6-7 ii) (12-(2-3)+10/2+4*2).[7M]
UNIT-3
2. a) Write a C program to traverse a given single linked list in reverse order. [7M]
b) Explain with an example, how linked lists can be used for polynomial representation.[7M]
5. a) Compare the performance of linked lists, stack, and queues with their sequential
counterparts.[7M]
b) Write an algorithm to perform insertion, deletion, and display in a doubly-linked
list.[7M]
6. a) List out the differences between array and linked list. [7M]
b) Write the procedure to add two polynomials using linked list.[7M]
UNIT-4
1. a) What is a threaded binary tree? Discuss its advantages and limitations. [7M]
b) Insert the sequence of integers 13, 3, 4, 12, 14, 10, 5, 1, 8, 2, 7, 9, 11, 6 and 18 in an
initially empty Binary Search Tree. Then delete 5 and 1. (Present the operations one
after the other in the same order).
2. a) Discuss about different representations of binary trees. Give an example for each. [7M]
b) Insert the sequence of integers 10, 20, 30, 40, 50, 60, 70, 80 and 90 in an initially
empty B-Tree. Then delete 40 and 70. (Present the operations one after the other.)[7M]
3. a) Write recursive functions for inorder, preorder and postorder traversal in a binary
tree.[7M]
b) Construct a max heap from the sequence of integers 13, 3, 4, 12, 14, 10, 5, 1, 8, 2, 7,
9, 11, 6 and 18. Then delete 2 minimum elements. (Present the operations one after
the other in the same order.)[7M]
4. a) Explain the procedure for deletion of an element from a binary search tree. [7M]
b) Present the preorder, inorder and postorder traversal of the below binary tree:[7M]
5. a) Write Recursive Algorithms for Pre-order, In-order, and Post-order traversals of
binary trees and explain them.[7M]
b) Write a function to find an element and its position in a binary search tree.[7M]
6. a) Define a Max Heap. Construct a max heap for the following:
{12, 15, 9, 8, 10, 18, 7, 20, 25}.[7M]
b) How can we make an unbalanced tree as a balanced one? Explain various
rotations that are involved in it. Give examples for each rotation.[7M]
UNIT-5
1. a) Compute shortest paths between every pair of vertices in the graph below using
appropriate algorithm.[7M]
2. a) Differentiate between BFS and DFS with algorithms and examples. [7M]
b) Compute minimum cost spanning tree for the graph below using Prim’s algorithm:[7M]
3. a) What is transitive closure? Compute transitive closure of the graph given below,
using Warshall’s algorithm:[7M]
b) Write and explain Kruskal’s algorithm for finding minimum cost spanning tree of a
graph.[7M]
4. a) Explain about various graph representations. Discuss the pros and cons of each. [7M]
b) Using Dijkstra’s algorithm, find shortest paths from vertex 0 to remaining vertices
in the graph given below.[7M]
5. a) How to find out the minimum cost spanning tree using the Prims algorithm? Explain
its algorithmic concept.[7M]
b) What is the articulation Point? What is its role in biconnected components? Explain
the program for finding articulation points.[7M]
6. a) Differentiate BFS and DFS. [7M]
b) Explain Kruskal’s algorithm with an example.[7M]
UNIT-6
2. a) Write and explain Binary Search algorithm. Also mention its time complexity. [7M]
b) Sort the below list of elements in ascending order using quick
sort:29, 23, 17, 57, 34, 89, 65, 27.[7M]
4. a) What is hashing? Explain its role, advantages and disadvantages w.r.to searching. [7M]
b) Sort the below list of elements in ascending order using shell sort:
3 7 9 0 5 1 6 8 4 2 0 6 1 5 7 3 4 9 8 2 [7M]
5. a) What are the applications of hashing? Explain different methods for resolving
collisions.[7M]
b) Take a list of unsorted elements and sort them with selection sort and bubble sort.[7M]
6. a) Explain quick sort algorithm and simulate it for the following data:
20, 35, 10, 16, 54, 21, and 25.[7M]
b) Write an algorithm for linear search. [7M]