In the context of recursion, what is the purpose of the "stack" data structure?पुनरावृत्ति के संदर्भ में, "स्टैक" डेटा संरचना का उद्देश्य क्या है?
Show answerHide answer
Correct answer: (A) To store variables and function calls for backtrackingकेवल चर को संग्रहीत करने के लिए b) backtracking
Explanation
Each recursive call pushes an activation record (local variables, parameters and return address) onto the call stack, which is popped when the call returns, allowing the program to backtrack to the caller.हर रिकर्सिव कॉल एक activation record (लोकल वेरिएबल, पैरामीटर और return address) call stack पर डालती है, जो कॉल लौटने पर हटता है, जिससे प्रोग्राम कॉलर तक वापस जा पाता है।