## Subroutine, Subroutine nesting and Stack memory

1. Subroutine – A set of Instructions which are used repeatedly in a program can be referred to as Subroutine. Only one copy of this… Read More »

## LIFO (Last-In-First-Out) approach in Programming

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 »

## FIFO vs LIFO approach in Programming

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 »

## Arithmetic Expression Evalution

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 »

## Flatten a binary tree into linked list | Set-2

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 »

## Sorting array using Stacks

Given an array of elements, task is to sort these elements using stack. Prerequisites : Stacks Examples : Input : 8 5 7 1 9… Read More »

## Data Structures | Stack | Question 8

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 »

## Data Structures | Stack | Question 7

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 »

## Data Structures | Stack | Question 6

The following postfix expression with single digit operands is evaluated using a stack: 8 2 3 ^ / 2 3 * + 5 1 *… Read More »

## Data Structures | Stack | Question 5

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 »

## Data Structures | Stack | Question 4

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 »

## Data Structures | Stack | Question 3

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 »

## Data Structures | Stack | Question 2

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 »

## Data Structures | Stack | Question 1

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 »