Skip to content

Tag Archives: cpp-stack

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
Write a function to print spiral order traversal of a tree. For below tree, function should print 1, 2, 3, 4, 5, 6, 7.   You… Read More
Given a string, write a recursive program to reverse it.    Recommended: Please try your approach on {IDE} first, before moving on to the solution.… Read More
Given a bracket sequence or in other words a string S of length n, consisting of characters ‘(‘ and ‘)’. Find the length of the… Read More
Given a binary tree, print the level order traversal in such a way that first two levels are printed from left to right, next two… Read More
Stacks are a type of container adaptors with LIFO(Last In First Out) type of working, where a new element is added at one end and… Read More
Stacks are a type of container adaptors with LIFO(Last In First Out) type of work, where a new element is added at one end and… Read More
Given a string str, we need to print reverse of individual words.Examples:   Input : Hello World Output : olleH dlroW Input : Geeks for Geeks… Read More
Stacks are a type of container adaptors that follow LIFO(Last In First Out) property, where a new element is added at one end and an… Read More
Stacks are a type of container adaptors with LIFO(Last In First Out) type of work, where a new element is added at one end called… Read More
Stacks are a type of container adaptors with LIFO(Last In First Out) type of working, where a new element is added at one end and… Read More
Write a function to print ZigZag order traversal of a binary tree. For the below binary tree the zigzag order traversal will be 1 3… Read More
Given an array of N distinct element of at least size 2. A pair (a, b) in an array is defined as ‘a’ is the… Read More
Given an expression, find and mark matched and unmatched parenthesis in it. We need to replace all balanced opening parenthesis with 0, balanced closing parenthesis… Read More

Start Your Coding Journey Now!