Question
Which data structure is most suitable for implementing
recursion?Solution
A stack is the most suitable data structure for implementing recursion. This is because recursive calls need to store the state of the current function execution before jumping into the next function call. Stacks follow the Last In, First Out (LIFO) principle, which perfectly suits the recursive function call structure. Why Other Options are Wrong: b) A queue follows First In, First Out (FIFO), which doesn’t support the nature of recursion. c) Linked lists can be used for dynamic memory but are not suitable for managing function calls in recursion. d) Arrays have a fixed size and do not inherently support LIFO behavior. e) Hash tables are for storing key-value pairs and have no role in recursion.
- Six persons (F, G, H, I, J, and K) live on different floors of a six-floor building. The bottommost floor is numbered as 1 and the topmost floor is numbere...
What is the direction of flat of Z with respect to flat of P?
Which is the odd man out?
Who among the following organized party immediately after B?Â
If M is related to R, R is related to P then Q is related to?
Who among the following likes Zoology?
Four among the following form a group in a certain way. Which of the following does not belong to group?
Which of the following friends, like Purple ? Â
C lives on which of the following floor?
Which of the following statement(s) is/are true?
I)Â The tie box is kept immediately above the Hat box
II)Â Gloves box is kept at th...