______ data structure is used in recursion.
2015
______ data structure is used in recursion.
- A.
Stack
- B.
Queue
- C.
Graph
- D.
Tree
- E.
Question not attempted
Attempted by 1124 students.
Show answer & explanation
Correct answer: A
Recursion involves a function calling itself, and each call must be stored with its current state (like parameters and return address). This storage follows a last-in, first-out (LIFO) order, where the most recent call is the first to be completed. The data structure that supports LIFO behavior is a stack. Therefore, a stack is used internally to manage function calls during recursion.
हिन्दी उत्तर: पुनरावर्तन में एक फ़ंक्शन खुद को कॉल करता है, और प्रत्येक कॉल को अपनी वर्तमान स्थिति (जैसे पैरामीटर और रिटर्न एड्रेस) के साथ स्टोर करना होता है। यह स्टोर लास्ट-इन-फर्स्ट-आउट (LIFO) क्रम का पालन करता है, जहाँ नवीनतम कॉल पहले समाप्त होता है। जो डेटा संरचना LIFO व्यवहार का समर्थन करती है, वह स्टेक है। इसलिए, पुनरावर्तन के दौरान फ़ंक्शन कॉल्स को प्रबंधित करने के लिए स्टेक का उपयोग किया जाता है।