(I-ME-CSE : R2017)
PART-A
1. What is mean by algorithm
2. Write any four properties of algorithm
3. Define algorithm validation
4. How to choose best searching algorithm
5. Write an algorithm to find the number of binary digits in the binary representation of the
positive decimal integer
6. What is average case analysis
7. What are the components of fixed and variable part in space complexity
8. Give any two example explaining the time space tradeoff
9. Prove that any comparison of sorting
10. Write down the properties of asymptotic notations
11. Define theta notation
12. Define little Oh and Omega Notations
13. Define Big-Oh notation
14. Write a recursive Fibonacci algorithm and its recursion relation
15. What is meant by substitution method
16. What is meant by linear search
17. Give example for recurrence equation
18. Write General plan for analyzing efficiency of recursive algorithm
19. Write an algorithm for factorial of numbers using recursion function
20. Write General plan for analyzing efficiency of non recursive algorithm
PART-B
1. Define the term algorithm and mention its properties
2. What are the steps that need to be followed while designing and analysis an algorithm?
3. Write the insertion sort algorithm and estimate its running time
4. What is space complexity ?With an example explain the components of fixed and variable
part in space complexity
5. Explain analysis framework of algorithm with suitable example
6. Discuss in detail all the asymptotic notation with example
7. Distinguish between Big-Oh ,Theta and Omega Notation
1
8. Discuss the properties of big-oh notation
9. Solve the following recurrence relation using substitution method(8)
1. T(n)=T(n-1)+1 with T(0)=0 as initial condition. Also find big-oh notation
2. T(n)=2T(n/2)+n
3. T(n)=T(n/3)+C with T(1)=1
4. T(n)=T(n-1)+n4
10. Solve the following recurrence relation using recursion tree method(8)
1. T(n)=2T(n/2)+n with T(1)=O(1)
2. T(n)=3T(n/4)+Cn2
11. Solve the recurrence relation using master method(8)
1. T(n)=5T(n-2)-6T(n-2)
2. T(n)=2T(n/2)+nlogn
3. T(n)=9T(n/3)+n3
12. Find the closest asymptotic tight bound by solving the recurrence equation T(n)=8T(n/2)+n2
with T(1)=1 using recursion tree method [Assume that T(1)€O(1)]
13. Suppose W satisfies the following recurrence equation and base (where C is a
constant)W(n)=c.n+W(n/2) and W(1)=1 what is the asymptotic order ofW(n)
14. Solve the recurrence equation(NOV/DEC12)(4+4)
𝑛
(1)T(n)={2𝑇 ( 2) + 3 𝑛 > 2
2 𝑛=2
15. Give the algorithm to check whether all the elements in a given array of n elements are
distinct. Find worst case Complexity of the same
16. Derive the recursion relation for fibonacci series algorithm also carry out the time
complexity analysis
17. Discuss How recurrence equation can be solved
18. Explain Towers of Hanoi problem and solve it using recursion
19. Show how to implement a stack using two queues. Analyze the running time of the stack
operation
PART-A
1. Give various implementation of tree
2. Define Binary and Complete binary tree
3. How is binary tree represented using an array?
4. Construct an expression tree for the expression A+(B-C)*D*(E+F)
5. Write an algorithm to declare node of a tree structure
6. What are the application of tree
7. What are B-tree
8. Enlist the properties of B-tree
9. What are red black tree
10. Explain the properties of red-black tree
2
11. What are the advantages of Fibonacci heap
PART-B
1. Discuss about various operation of binary search tree with suitable example(16)
2. Explain the insertion and deletion of nodes in the B-tree with suitable example and also
explain the properties of B-tree(16)
3. Explain the insertion and deletion of nodes in the Red-black tree with suitable example and
also explain the properties of Red-black tree(16)
4. Explain what are the operation performed in Fibonacci heap(16)
Problem(8)
1. Draw the binary search tree for the following input list 60,25,75,15,50,66,33,34.Trace the
algorithm to delete the node25,75,44,fromthe tree
2. Draw the Red-Black tree for the following input list 60,25,75,15,50,66,33,34.Trace the
algorithm to delete the node25,75,44,fromthe tree
3. Explain insertion procedure in Red-Black tree and insert the following sequence: {
20,10,5,30,40,57,3,2,4,35,25,18,22,21} (8)
4. Construct a binary search tree by inserting 30,10,4,19,62,35,28,73 into an initially empty
tree .show the result of splaying the nodes 4, 62 one after the other of the constructed
tree.(10)
5. construct a B-tree with order m=3 for the key values 2,3,7,9,5,6,4,8,1 and delete the values
4,6,show the tree in performing all operations(6)
PART-A
3
PART-B
1. Discuss Prim’s and Kruskal’s algorithm for computing the minimal spanning tree weighted
undirected graph(16)
(OR)
i)Explain Prim’s algorithm to find the minimum spanning tree for a graph(8)
ii) Explain Kruskal’s algorithm to find the minimum spanning tree for a graph(8)
2. Explain BFS and DFS in detail .Write the algorithm(16)
(OR)
i) Explain breadth first search algorithm for traversal of any graph with suitable
example? Define the time complexity(8)
ii) What is graph? Explain the depth first search tree (8)
3. Explain the topological Sorting algorithm(8)
4. Discuss all pair Shortest path algorithm with an example (16)
(OR)
i)Explain Dijkstra’s algorithm with suitable example(8)
ii)Explain Floyd’s Algorithm with suitable example(8)
iii)Explain about warshall algorithm with example
Apply Prim’s algorithm to find a minimum spanning tree of a graph(8)
1
b c
5 3 4 6
a d e
6 2
Sort the given digraph using topological sort with suitable step(8)
A D
B E
4
8. i)Write an algorithm, for breath first search on a gragh and give the nodes of the graph G
given diagram based on the algorithm
ii)using Dijikstra’s algorithm find the shortest path from the source to all other nodes of the
graph given (16)
2
V1 V2
4 1 3 10
V4
V3 5 2 2 V5
5 8 6
1
V6 V7
Consider a directed acylic graph D given in fig sort the node nodes of ‘D’ by applying
topological sort on D(10)
C
F
A B E
D
G
.
ii)find the shortest path from each vertex to all other vertex(8)
2 4
3
8 3
1
7 1
2
4 5
5 4
6
5
Explain Prim’s and Kruskal algorithm .Find the minimum spanning tree for the following graph
using any one of the algorithm’s(16)
3
b c
4 4 2 3
2 11
a e d
2 1 3
5
f g
4
PART-A
6
GREEDY TECHNIQUE
Prim’s algorithm
4
1 3
2
6
216 7 5 7
4
9
Kruskal’s Algorithm
7
Huffman trees
6. The Binary string below in the title of a song encoded using Huffman code
001100010111110011101100000100111010010101
Gibe n the letter frequencies listed in the table below build the Huffman coded and use them
to decode the title .In cases where there are multiple greedy choices the coded are assembled
by combining the first letters from left to right in the order given in the table.Also the code
are assigned by labeling the left and right branches of the prefix/code tree with ) and 1
respectively
Letter a h v w ‘’ e t l o
Frequency 1 1 1 1 2 2 2 3 3
7. Write the procedure to compute Huffman code(6)
8. Let A={l/119,m/96,c/247,g/283,h/72,f/77,k/92,j/19}be the letters and its frequency of
distribution in a text file .Compute a suitable Huffman coding to compress the data
effectively(8)
9. Explain about Huffman tree with example(8)
PART-A
P-NP-NP Complete Problems
1. Depict the proof which says that a problem ‘A’ is no harder or no easier than problem
‘B’
2. How NP hard problem are different from NP-Complete
3. Compare NP-hard and NP-completeness
4. State the property of NP-Complete Problem
5. List the two properties that must be satisfied by a problem L to be NP complete
6. What is NP Completeness
PART-B