aiml dsa (1)
aiml dsa (1)
SECTION – A (2 MARKS)
i*=k
value += 1;
31. How the insertion sort is done with the array? III
Demonstrate the selection sort results for each pass for the III
33. following initial array of elements
21 6 3 57 13 9 14 18 2
Find the time complexity for the following sorting technique. III
34.
a) Quick sort and b) Merge Sort.
44. Compare the linear search with binary search algorithm. III
60. List out two important key points of depth first search. IV
67. What is heap and how many types of heaps are available? V
75.
S. No Questions Unit
Construct an algorithm to display the factorial of the
I
number and compute the time complexity using
backward substitution method.
int funt( int n)
{
if ( n == 0 ) return 1;
1.
else
{
return (n*funt( n - 1);
}
}
b) Josephus Problem
Construct the binary search algorithm and find the key III
40. element 35 from the given list of sorted elements in an
array A=[2,12,30,35,46,53,60,70,75]
57.
V
69. Construct an AVL Tree for the given sequence 21, 26, 30,
9, 4, 14, 28, 18,15,10, 2, 3, 7 in step by step process