Question
What is the primary advantage of using a stack in
recursive algorithms?Solution
Stacks are crucial in recursive algorithms because they support backtracking by maintaining a history of function calls. Every recursive call is pushed onto the stack, and when a base condition is met, the stack unwinds (pops) the calls in reverse order. This property is integral for problems like solving mazes, tree traversal (DFS), or evaluating expressions. The Last-In-First-Out (LIFO) nature of stacks ensures that the most recent state is resumed first, making them perfect for backtracking scenarios. Why Other Options Are Incorrect ·        Option 1 (Efficient sorting): Stacks are not inherently used for sorting. Algorithms like Quick Sort and Merge Sort do not directly depend on stacks for sorting efficiency. ·        Option 2 (Memory allocation for variables): This is managed by the program's runtime stack, not the data structure itself. ·        Option 4 (Managing concurrent processes): This is more relevant to queues or process schedulers. ·        Option 5 (Sorting data): Stacks are used in algorithms like stack-based parsing but are not designed for general sorting.
How many total medals did India win at the 26th Asian Athletics Championships, marking its best foreign performance in 40 years?
What percentage of the workforce in India’s handicrafts sector comprises women?
What is the new ceiling for FCNR(B) deposit rates set by the RBI for the 1-3 years maturity period?
How much of the Brics + export share was contributed by China in 2023?
On which date is the Indian Air Force scheduled to receive its first Tejas Mk1A fighter jet?
- At which event was PM Narendra Modi conferred with the highest civilian award of Mauritius?
NABARD, as an apex institution, provides refinancing support to financial institutions. Which of the following best defines NABARD’s refinancing funct...
Who was appointed as Pakistan’s first Chief of Defence Forces (CDF) in December 2025?
As per SIPRI Report 2025, what percentage of global arms imports is accounted for by India during 2021–2025?
According to the UNDP 2025 report on the Forest Rights Act (FRA), how many acres have been titled so far under FRA?