Professional KnowledgeHardIBPS SO IT
Which data structure does BFS use and which does DFS use (iterative)?
- A. Stack and queue
- B. Both queue
- C. Both stack
- D. Queue and stack
Correct answer: D. Queue and stack
BFS is level order via a queue; DFS uses a stack or recursion.
Practise more IT Officer Professional Knowledge (IBPS SO) questionsIT Officer Professional Knowledge (IBPS SO): notes and key points
More IT Officer Professional Knowledge (IBPS SO) questions
- Evaluate the postfix expression 5 3 2 + 4 - :
- A stack permutation: pushes 1, 2, 3, 4 in order. Which output sequence is impossible?
- The time complexity of inserting at the head of a singly linked list is:
- Time to build a BST from n keys already sorted in ascending order by successive insertion is:
- 0/1 knapsack with capacity W and n items by dynamic programming has complexity:
- Edit distance between kitten and sitting is: