WWW - Manaresults.Co - In: B) What Is Recursion? Give The Properties of A Recursive Definition of An Algorithm.
WWW - Manaresults.Co - In: B) What Is Recursion? Give The Properties of A Recursive Definition of An Algorithm.
PART- A
(25 Marks)
1.a) What is linked list? Write advantages of doubly linked list over singly linked list.
[2]
b) What is recursion? Give the properties of a recursive definition of an algorithm.
[3]
c) What is a stack? List the applications of stack. [2]
d) Show the detailed contents of stack to evaluate the given postfix expression. [3]
{1 2 3 + * 3 2 1 - + *}
e) Define a graph. List different graph traversal techniques. [2]
f) What are binary trees? Mention different types of binary trees with example. [3]
g) What is hashing? [2]
h) What is sorting? What is searching? [3]
i) Define AVL tree? Give example. [2]
j) What is B-tree of order m? Draw a B-tree of order 3. [3]
PART-B
(50 Marks)
2.a) What is amortized complexity? Explain different methods to arrive at amortized
costs for operations.
b) Write a C program to implement insertion to the immediate left of the Kth node in
singly linked list. [5+5]
OR
3. Given an ordered linked list whose node is represented by ‘key’ as information
and ‘next’ as link field. Write a C program to implement deleting number of
nodes (consecutive) whose ‘key’ values are greater than or equal to ‘Kmin’ and
less than ‘Kmax’. [10]
4.a) Write a C program to implement multiple stacks using single array.
b) Convert the infix expression a / b – c + d * e – a * c into postfix expression and
trace that postfix expression for given data a = 6, b = 3, c = 1, d = 2, e = 4.[5+5]
OR
www.ManaResults.co.in
6.a) Construct a binary tree having the following traversal sequences:
Preorder traversal: A B C D E F G H I
Inorder traversal: B C A E D G H F I
b) Implement Depth First Search (DFS) algorithm. [5+5]
OR
7.a) Define a Max Heap. Construct a max heap for the following:
{12, 15, 9, 8, 10, 18, 7, 20, 25}
b) What is a graph? Explain various representations of graphs. [5+5]
---oo0oo---
www.ManaResults.co.in