TGPSC HMWSSB Manager Data Structures previous year questions with answers
Every Data Structures question asked in the TGPSC HMWSSB Manager (Engineering) papers on this site, grouped by topic. Answers come from TSPSC's final key; each has a short explanation (free here for a sample, all of them in the practice app).
Practise Data Structures onlineArrays, Stacks, Queues & Linked Lists
Which of the following is the correct sequence of the statements to be executed to insert a node after a node whose address is p? The pointer field nextptr points to the next node and the address of the new node is q.
- p->nextptr=q; q->nextptr=p;
- p->nextptr=q; q->nextptr=p->nextptr;
- q->nextptr=p->nextptr; p->nextptr=q;
- q->nextptr=p->nextptr; p->nextptr=q->nextptr;
Show answer
Answer: (3) q->nextptr=p->nextptr; p->nextptr=q;
Explanation: open it in the practice app. It needs the ₹149 All-in-One Pass: one payment for every exam on the site.
Trees & Heaps
Which of the following tree need not be a binary tree
- BST
- AVL
- Heap
- B-Tree
Show answer
Answer: (4) B-Tree
Explanation: open it in the practice app. It needs the ₹149 All-in-One Pass: one payment for every exam on the site.
The number of binary trees with 3 nodes which when traversed in post-order gives the sequence A, B, C is
- 3
- 9
- 7
- 5
Show answer
Answer: (4) 5
Explanation: open it in the practice app. It needs the ₹149 All-in-One Pass: one payment for every exam on the site.
Hashing & Graph Representation
Consider a hash function h(k) = k mod 9 and a hash table consisting of 9 slots, where the collisions are resolved by chaining. If the following keys are inserted in the order: 5, 28, 19, 15, 20, 33, 12, 17, 10, then what are the maximum, minimum and average chain lengths for the given instance.
- 3, 0, and 1
- 3, 3, and 3
- 4, 0, and 1
- 3, 0, and 2
Show answer
Answer: (1) 3, 0, and 1
Explanation: open it in the practice app. It needs the ₹149 All-in-One Pass: one payment for every exam on the site.