Question 21Asked in Bihar STET 2025 Paper II Computer Science, 3 Nov 2025, Shift 2 (2:00 PM)

In the context of recursion, what is the purpose of the "stack" data structure?पुनरावृत्ति के संदर्भ में, "स्टैक" डेटा संरचना का उद्देश्य क्या है?

पुनरावृत्ति के संदर्भ में, "स्टैक" डेटा संरचना का उद्देश्य क्या है?
  1. ATo store variables and function calls for backtrackingकेवल चर को संग्रहीत करने के लिए b) backtracking
  2. BTo store only variablesके लिए चर और फ़ंक्शन कॉल को संग्रहीत करने के लिए
  3. CTo store only function callsलूप काउंटरों को स्टोर करने के लिए केवल फंक्शन कॉल
  4. DTo store loop countersस्टोर करने के लिए
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 पर डालती है, जो कॉल लौटने पर हटता है, जिससे प्रोग्राम कॉलर तक वापस जा पाता है।

From Bihar STET 2025 Paper II Computer Science PYQ, 3 Nov 2025, Shift 2 (2:00 PM)

This is question 21 of Bihar STET 2025 Paper II Computer Science PYQ, 3 Nov 2025, Shift 2 (2:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.