Top Data-Structures Interview Questions
Mobiprep handbooks are free downloadable placement preparation resources that can help you ace any company placement process. We have curated a list of the 40 most important MCQ questions which are asked in most companies such as Infosys, TCS, Wipro, Accenture, etc. The placement handbooks also have detailed explanations for every question ensuring you revise all the questions with detailed answers and explanations.
Question
21
Explanation
Name some rotation technique that are used to balance AVL tree.
Left rotation
Right rotation
Left-Right rotation
Right-Left rotation
Question
22
Explanation
What do you mean by a hash table? What is hashing?
Hash table is a data structure which stores data in a key value pair. In a hash table, data is stored in an array format, where each data value has its own unique index value.
Hashing is a technique to convert a range of key values into a range of indexes of an array.
Question
23
Explanation
Explain DFS.
DFS is an algorithm to traverse graphs and trees. It traverses a graph in a depthward motion and uses a stack to remember to get the next vertex to start a search, when a dead end occurs in any iteration.
Steps:
STEP 1 − Visit the adjacent unvisited vertex. Mark it as visited. Display it. Push it in a stack.
STEP 2 − If no adjacent vertex is found, pop up a vertex from the stack. (It will pop up all the vertices from the stack, which do not have adjacent vertices.)
STEP 3 − Repeat Rule 1 and Rule 2 until the stack is empty.
Question
24
Explanation
What is BFS?
BFS is an algorithm that traverses a graph in a breadthward motion. It uses a queue to remember to get the next vertex to start a search, when a dead end occurs in any iteration.
Steps:
Step 1 − Visit the adjacent unvisited vertex. Mark it as visited. Display it. Insert it in a queue.
Step 2 − If no adjacent vertex is found, remove the first vertex from the queue.
Step 3 − Repeat Rule 1 and Rule 2 until the queue is empty.



.png)