You are on page 1of 4

1. What are the characteristics of an algorithm?

2. Write the different methods to solve the recurrence equation.


3. What is P-class problem?
4. What will be the time complexity of the given program segment?

int fact ( int n)

if(n==0)

return 1;

else

return n* fact(n-1);

5. Rank the following functions by their order of growth in ascending order.

n2, n, ln n, n3, 2n

6. Write the Different steps of divide and conquer algorithm.


7. Show that (n+1)5 is O (n5).
8. Which of the following algorithm design techniques is used by quick sort?
(I) Dynamic Programming (II) Back Tracking (III) Divide and Conquer
9. What is single source shortest path problem?
10. What is the difference between BFS and DFS?
11. How the Greedy paradigm of algorithm differs from that of Dynamic
programming?fc
12. Which of the following sorting algorithms has the lowest worst case
complexity?
(I)Quick Sort (II)Merge Sort (III)Selection Sort (IV)Heap Sort
13. Write in detail different phases of algorithm.
14. Write in details about the convex hull problem and closest pair problem.
15. What are the different algorithms to search an element?
16. Write the procedure of Substitution method to solve the recurrence equation.
17. Which data structure is used in BFS and DFS?
18. Solve the Recurrence relation T(N) = 2T(N/4) + N, for N≥2 with T(1) = 1.
19. Explain the various criteria used for analyzing algorithms.
20. What is meant by divide &conquer?

21. Consider the recurrence T n= {1 n=1


2T (⌊ n/2 ⌋)+n n>1
Find the asymptotic bound on T.
22. Find out the asymptotic bound for the given recurrence using recursion tree method.
T(n) = 3T(n/4) + cn2
23. Find out the asymptotic bound for the given recurrence equation by using recurrence
method. T(n) = 2T(n/2) + n2.
24. Find out the asymptotic bound for the given recurrence equation by using recurrence
method. T(n) = T(n/3) + T(2n/3) + n.
25. Give two real time problems that could be solved using greedy algorithm.
26. How to find the complexity of an algorithm?
27. How to identify the efficient allogrithm?
28. Use master method to solve the following recurrence
T(n)=9T(n/3) + n
29. Differentiate between dynamic programming and Divide and conquer method.
30. Find the worst case time complexity of Quick sort?
31. Define NP-Complete and NP-Hard problem.
32. How is O-notation different form Ω -notation?
33. Differentiate between BFS and DFS.
34. Solve the given text using Brute force string matching algorithm with the given pattern.
Text= TWO ROADS DIVERGED IN A YELLOW WOOD
Pattern= ROADS
35. Write the algorithm of Quick sort.
36. Find the worst case time complexity of quick sort with recurrence equation.
37. Sort the following elements using Merge sort: 7, 5, 4, 8, 12, 10, 9, 6, 2, 4
38. Write an algorithm of Floyd’s Algorithm with the time complexity.
39. Take any undirected graph and find the MST using Kruskal’s algorithm.
40. Take any undirected graph and find the MST using Prim’s algorithm.
41. Explain the step by step procedure of Dijkstra’s algorithm.
42. What is Knapsack problem? Write the different knapsack problems. Explain the procedure of
0/1 Knapsack problem.
43. Define P, NP and NP- Complete Problems.
44.
45. Determine minimal spanning tree for given gra--ph using Prim’s algorithm.**

46. Determine minimal spanning tree for given graph using Kruskal’s algorithm.

47. Use Dijkstra’s algorithm for solving single source shortest path problem on a given directed
graph.
48. Implement the fractional knapsack problem using C. Let us consider that the capacity of the
knapsack W = 60 and the list of provided items are shown in the following table −

Item A B C D

Profit 80 10 20 30

Weight 40 5 10 4

49. Write an algorithm for Huffman tree. Construct a Huffman tree for the given text and the
text is “DESIGN AND ANALYSIS OF ALGORITHM”. Show binary encoding of each character.
50. Write an algorithm for Huffman tree. The frequency with which each character occurs in a
file is shown in the given table. Construct a Huffman tree corresponding to these frequencies
and show binary encoding of each character.

Character a b c d e f g h
Frequency 1 8 7 10 12 5 4 2

51. Write an algorithm Fractional Knapsack. Suppose the capacity of the knapsack is 30.
The Profit array is {25, 30, 40} and the corresponding Weight array is {10, 15,
18}.Find profit based on minimum weight.
52. What is the difference between fixed length codeword and variable length code word.
Explain with an example.
53. For the following graph having four nodes represented by the matrix given below
determine the all pairs source shortest path.

54. Discuss the classes P, NP, NP complete, and NP hard with examples. How can we
show that a problem is NP complete?
55. What do you understand by Polynomial time reducibility?
56. Use Floyd’s-Warshall’s algorithm to find the shortest paths for all pairs of vertices in
the given graph.
57. Write an algorithm for Selection Sort and sort the following elements: 7, 5, 4, 8, 12, 10, 9, 6,
2, 4
58. Write an algorithm for Bubble Sort and sort the following elements: 7, 5, 4, 8, 12, 10, 9, 6, 2,
4
59. Write an algorithm for Sequential search and search element from the following given
elements: 7, 5, 4, 8, 12, 10, 9, 6, 2, 4
60. Write an algorithm for Depth-First Search (DFS) and find its time complexity.
61. Write an algorithm for Breadth-First Search (BFS) and find its time complexity.
62. Show that the worst case running time of Quick sort algorithm is n2.
63. Define asymptotic notations. Write its type.
64. Write the master method of recurrence equation.
65. What do you mean by time complexity and space complexity of an algorithm?
66. Construct a Huffman tree for the given text and the text is “REPETITIVE
SENTENCE EXAMPLE”. Show binary encoding of each character.
67. Write short notes on Lower bounds for sorting
68. What are the different ways to traverse the binary tree?
69. Explain about the optimal binary search tree.
70. Write an algorithm of Brute Force search and find its time complexity.
71. Match the pattern P= ABB from the given text T = AAAAABBABBABBBACBBCAABCCCACCC by
using Brute Force search.
72. Differentiate between brute force search
73. and exhaustive search approach.

You might also like