LawMint Sign in

Telangana SET (TG SET) Data Structures and Algorithms Previous Year Questions

Try the preview and open any solution for a worked explanation.

Telangana SET (TG SET) practice pack

The practice pack for Telangana SET (TG SET) is coming soon to LawMint.

Question 1

Which of the following correctly lists the functions in increasing order of their asymptotic growth rates as n→∞n \to \infty?

Select one answer

Question 2

Consider the following recurrence relation: f(n)f(n) \(= \begin{cases} 0, & \text{if } n\) \(= 0 \\ 2f(n-1) + 1, & \text{if } n\) \(> 0 \end{cases}\)
What is the asymptotic time complexity of f(n)?

Select one answer

Question 3

Consider the algorithms and computational problems listed in List I and their corresponding algorithmic design strategies listed in List II.

List I (Algorithm/Problem)List II (Algorithm Design Strategy)
a. Merge Sorti. Divide and conquer
b. 0/1 Knapsackii. Dynamic Programming
c. Prim's Algorithm for finding Minimum Spanning Treeiii. Greedy
d. N-Queens Problemiv. Backtracking
Which of the following correctly matches the problems in List I with the corresponding algorithmic strategies in List II?

Select one answer

Question 4

A hash table of length 10 uses open addressing with hash function h(k)=k mod 10, and linear probing. After inserting the following six keys into an initially empty hash table, the table is as shown below:

0123456789
254262231934165220465233
Which one of the following choices gives a possible order in which the key values could have been inserted in the table?

Select one answer

Question 5

After inserting the key 23 into the AVL tree and performing the necessary rotations to restore the AVL property, the resulting tree is stored in an array using level-order (breadth-first) traversal, from left to right at each level.

AVL tree with root 36; children 12 and 44; children of 12 are 7 and 17; children of 44 are 38 and 45; children of 7 are 3 and 10; right child of 17 is 27. Heights: 36 has 3; 12 has 2; 44, 7 and 17 have 1; 3, 10, 27, 38 and 45 have 0.

Which of the following represents the contents of the array?

Select one answer

Question 6

Consider the following statements about representation of a graph G with m edges and n nodes.
I. The adjacency matrix representation requires O(n3) space.
II. The adjacency list representation requires O(n2) space.
III. The adjacency matrix representation requires O(n2) space.
IV. The adjacency list representation requires O(m+n) space
Which of the statements about the graph is/are true?

Select one answer

Question 7

Five elements A, B, C, D, and E are pushed onto an initially empty stack in that order. The top element is then popped four times, and each popped element is immediately enqueued into an initially empty queue. Next, two elements are dequeued from the queue and pushed onto the stack, in the order in which they are removed from the queue. Finally, one element is popped from the stack. Which of the following is the element popped in the final step?

Select one answer

Question 8

Consider the following sequential (array) representation of a binary tree, where the nodes are stored in level-order.

Index0123456789
NodeABCDEFGHIJ
Which one of the following is a postorder traversal?

Select one answer

Question 9

Which of the following correctly defines an NP-Complete Problem?

Select one answer

Question 10

Assume that no built-in function for exponentiation is available. Given a number x and a positive integer n, you need to compute xn using multiplication. What is the time complexity of the optimal algorithm for computing xn?

Select one answer

Continue practising

The practice pack for Telangana SET (TG SET) is coming soon to LawMint.

Telangana SET (TG SET) practice pack

The practice pack for Telangana SET (TG SET) is coming soon to LawMint.