All Exams Test series for 1 year @ ₹349 only
Question

Which of the following is not an inherent application of stack ?

The correct answer is
Job scheduling

Stack Applications Explained

A stack is a data structure that follows the Last-In, First-One (LIFO) principle. Let's analyze the given options to determine which is not an inherent application of a stack.

1. Implementation of Recursion

Recursion relies heavily on the function call stack. When a function calls itself, the current state (variables, return address) is pushed onto the call stack. When the function returns, the state is popped off. This makes stack usage fundamental for recursion.

2. Evaluation of a Postfix Expression

Evaluating postfix expressions (e.g., $3 4 + 2 *$) is a classic stack application. Operands are pushed onto the stack. When an operator is encountered, the required operands are popped, the operation is performed, and the result is pushed back onto the stack.

3. Job Scheduling

Job scheduling algorithms manage the order in which tasks or processes are executed by a system. Common scheduling algorithms often use queues (First-In, First-One - FIFO) or priority queues, which prioritize tasks based on certain criteria (like urgency or resource needs). While a stack could technically be used to store jobs, its LIFO nature is generally inefficient and unsuitable for typical job scheduling requirements, which often need fairness or timely processing. Therefore, it is not considered an inherent application.

4. Reverse a String

Reversing a string is easily achieved using a stack. Each character of the string can be pushed onto a stack. Subsequently, popping the characters one by one retrieves them in reverse order, effectively reversing the string.

Conclusion

Based on the analysis, Job scheduling (Option C) does not inherently require or benefit from the LIFO principle of a stack, unlike the other options listed.

Was this answer helpful?

Important Questions from Stack

  1. Single array a[0: MAXSIZE - 1] is used to implement two stacks. The two stacks grow from apposite ends of the array. Variables top 1 and top 2 (top1 < top2) point to the location of the topmost element in each of the stacks if the space is to be used efficiently, The condition for "stack full" is____________.

  2. Match the following :
    (1) PUSH(a) STACK
    (2) FIFO(b) Stack insertion
    (3) POP(c) QUEUE
    (4) LIFO(d) Stack deletion
  3. What is the final value of the postfix expression BCDAD-+-+.
    where A=2, B=3, C=4, D=5.
  4. Consider the following operations performed on a stack of size 5 :
    Push (a); Pop() ; Push(b); Push(c); Pop();
    Push(d); Pop();Pop(); Push (e)
    Which of the following statements is correct ?
  5. Stack is also known as

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App