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
Category Archives: Stack
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, 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