Tag Archives: Data Structures-Stack

1. Subroutine – A set of Instructions which are used repeatedly in a program can be referred to as Subroutine. Only one copy of this Instruction… Read More
Prerequisites – FIFO (First-In-First-Out) approach in Programming, FIFO vs LIFO approach in Programming LIFO is an abbreviation for last in, first out. It is a… Read More
Prerequisite – FIFO (First-In-First-Out) approach in Programming FIFO is an abbreviation for first in, first out. It is a method for handling data structures where… Read More
The stack organization is very effective in evaluating arithmetic expressions. Expressions are usually represented in what is known as Infix notation, in which each operator… Read More
Given a binary tree, flatten it into a linked list. After flattening, the left of each node should point to NULL and right should contain… Read More
Given an array of elements, task is to sort these elements using stack. Prerequisites : Stacks Examples : Input : 8 5 7 1 9… Read More
A single array A[1..MAXSIZE] is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables top1 and top2 (topl<… Read More
Let S be a stack of size n >= 1. Starting with the empty stack, suppose we push the first n natural numbers in sequence,… Read More
The following postfix expression with single digit operands is evaluated using a stack: 8 2 3 ^ / 2 3 * + 5 1 *… Read More
Following is an incorrect pseudocode for the algorithm which is supposed to determine whether a sequence of parentheses is balanced: filter_none edit close play_arrow link… Read More
Consider the following pseudocode that uses a stack filter_none edit close play_arrow link brightness_4 code declare a stack of characters while ( there are more… Read More
Which of the following is true about linked list implementation of stack? (A) In push operation, if new nodes are inserted at the beginning of… Read More
Which one of the following is an application of Stack Data Structure? (A) Managing function calls (B) The stock span problem (C) Arithmetic expression evaluation… Read More
Following is C like pseudo code of a function that takes a number as an argument, and uses a stack S to do processing. filter_none… Read More