B.Tech. III Semester
Examination, November 2022
Grading System (GS)
Max Marks: 70 | Time: 3 Hours
Note:
i) Answer any five questions.
ii) All questions carry equal marks.
iii) In case of any doubt or dispute the English version question should be treated as final.
a) What are the merits and demerits of array? Given two arrays of integers in ascending order, develop an algorithm to merge these arrays to form a third array sorted in ascending order. (Unit 2)
b) Given a 2D array A[-100, 50:-5, 50]. Find the address of element A[99, 49] considering the base address 10 and each element requires 4 bytes for storage. Follow row major order. (Unit 2)
a) Write an algorithm of Heap sort. Sort the given sequence with the help of heap sort:
50, 48, 35, 44, 80, 70, 10, 55, 11, 85 (Unit 2)
b) How do you find the complexity of an algorithm? What is the relation between the time and space complexities of an algorithm? Justify your answer with an example. (Unit 1)
a) Differentiate between linear search and binary search techniques. Write a C program to search an element in an array using binary search. Also write its time complexity. (Unit 2)
b) What are the advantages of linked list over array? Write an algorithm/C code to insert a node at the end of a singly linked list. (Unit 4)
a) Write an algorithm/C program that reverses the order of all the elements in a singly linked list. (Unit 4)
b) Write an algorithm for the evaluation of a postfix expressions. (Unit 3)
a) Convert the following infix expression to prefix and postfix expression using stack:
$((2+3)*4+(5*(6+7)*9))$ (Unit 3)
b) Show the addition of given polynomials using linked list:
$P=3x^{2}+2x+7$
$Q=5x^{3}+2x^{2}+x$ (Unit 4)
a) What is Tree data structure? What are the different types of tree? (Unit 5)
b) Show that the maximum number of nodes in a binary tree of height h is $2^{h+1}-1$ (Unit 5)
a) What do you mean by stack? What do you mean by overflow and underflow condition? Write an algorithm/C function for push and pop operations. (Unit 3)
b) Explain DFS and BFS algorithm supporting with the example. (Unit 5)
a) Construct a binary tree for given Sequence.
IN ORDER: 9, 12, 14, 17, 23, 19, 50, 54, 67, 72, 76
POST ORDER: 9, 14, 12, 19, 23, 17, 67, 54, 76, 72, 50 (Unit 5)
b) Explain Garbage collection and compaction. (Unit 4)