## Check if the elements of stack are pairwise sorted

Given a stack of integers, write a function pairWiseSorted() that checks whether numbers in the stack are pairwise sorted or not. The pairs must be… Read More »

Given a stack of integers, write a function pairWiseSorted() that checks whether numbers in the stack are pairwise sorted or not. The pairs must be… Read More »

Given a Queue of integers. The task is to check if consecutive elements in the queue are pairwise consecutive. Examples: Input : 1 2 5… Read More »

Given an array, print the Next Greater Element (NGE) for every element. The Next greater Element for an element x is the first greater element… Read More »

Prerequisites – Recursion, Backtracking and Stack Data Structure. A Maze is given as N*M binary matrix of blocks and there is a rat initially at… 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 »

Given Inorder and Postorder traversals of a binary tree, print Preorder traversal. Example: Input: Postorder traversal post[] = {4, 5, 2, 6, 3, 1} Inorder… Read More »

Approved Offer. Bank Of America has visited our college for on campus recruitment . The recruitment consisted of 4 Rounds in total. The recruitment was… Read More »

Given an array, print the Next Smaller Element (NSE) for every element. The Smaller smaller Element for an element x is the first smaller element… 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 »

The computers which use Stack based CPU Organization are based on a data structure called stack. Stack is a list of data words. It uses… Read More »

Online Round: This round was held on Hackerrank for 1:30 hrs. There were two questions in this round. A tree was given with upto 10^5 nodes.… Read More »

There were a total of 3 rounds. 1st was online coding, 2nd was written coding and last round was divided in three parts, basically 3… Read More »

You are given 3 stacks, A(Input Stack), B(Auxiliary Stack) and C(Output Stack). Initially stack A contains numbers from 1 to N, you need to transfer… Read More »

Given q number of queries, you need to perform operations on the stack. Queries are of three types 1, 2 and 3. If the operation… Read More »

Given lengths of n rods in an array a[]. If any person picks any rod, half of the longest rod (or (max + 1) /… Read More »