Which data structure is used for implementing recursion?
Queue
Linked List
Stack
Array
[ Option C ]
Recursion is when a function calls itself to solve smaller subproblems. Every time a function is called: its parameters, local variables, return address, must be saved before the function can call itself again. This saving and restoring is managed by a stack.
What data structure would you choose to implement "undo" feature in a word processor?
Queue
Stack
Dequeue
None of these
[ Option B ]
The stack is most suitable data structure since it works in LIFO (Last-In-First-Out) ordering. All these actions are pushed into stack and whatever action has to be reversed (undoed) can be just popped off the top of the stack.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.