# Category Archives: Stack

Given a singly linked list, rearrange the list so that even and odd nodes are alternate in the list.There are two possible forms of thisâ€¦ Read More
Given an array arr[] of size N. The task is to count the number of unique differences between the two maximum elements of every subarrayâ€¦ Read More
Given string str of size N containing only lowercase English letters. The task is to encrypt the string such that the substrings having same prefixâ€¦ Read More
Pre-requisite:  Linked List Data StructureStack vsHeap Memory Allocation The Linked List is a linear data structure, in which the elements are not stored at contiguousâ€¦ Read More
In this article, we will see how to create a data structure that can handle multiple stacks with growable size. The data structure needs toâ€¦ Read More
Given two arrays S1 and S2 containing N and M integers, and an integer K, the task is to find the maximum number of integersâ€¦ Read More
Given an array arr[], the task is to count the number of triplets such that i < j <k and a[ j ]< a[ kâ€¦ Read More
Given an array arr[] of N integers, the task is to find the maximum possible value of (min * sum) among all possible subarrays havingâ€¦ 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
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
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
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
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
Given an expression string exp, write a program to examine whether the pairs and the orders of “{“, “}”, “(“, “)”, “[“, “]” are correctâ€¦ Read More
Given an expression string exp, write a program to examine whether the pairs and the orders of “{“, “}”, “(“, “)”, “[“, “]” are correctâ€¦ Read More