Skip to content

Category Archives: Stack

Prerequisite: List, Stack Lists are sequence containers that allow non-contiguous memory allocation. As compared to vector, list has slow traversal, but once a position has… Read More
Given a string S consisting of only lowercase letters, the task is to find the lexicographically largest string that can be obtained by removing K… Read More
Given an array arr[], the task is to print the number of elements which are greater than all the elements on its left as well… Read More
A function is a set of code that performs a specific task and can be used whenever needed just by calling it. While using multiple… Read More
Given a string S, the task is to change the string id it doesn’t follow any of the rules given below and print the updated… Read More
Given an array arr[], the task is to check that if there exist a triplet (i, j, k) such that arr[i]<arr[k]<arr[j] and i<j<k then print… Read More
Given an integer N, which denotes the size of the matrix that is N*N. There is a robot placed over the top-left corner (0, 0)… Read More
C++ filter_none edit close play_arrow link brightness_4 code // C++ code #include <iostream> #include <utility> using namespace std;   int main() {     // Declaring the… Read More
Array: An Array is a collection of items stored at contiguous memory locations. The idea is to store multiple items of the same type together.… Read More
Given an array arr[] of size N and integer Y, the task is to find a minimum of all the differences between the maximum and… Read More
Given a valid parenthesis string S, the task is to find the weight of parenthesis based on the following conditions: Weight of “( )” is… Read More
Given string str, the task is to check if characters at the odd indexes of str form a palindrome string or not. If not then… Read More
Given a binary tree of N nodes, the task is to print level order traversal in a spiral form. In spiral form, nodes at the… Read More
Given a string htmlCode which is HTML code of a webpage, the task is to find the missing end tag in the HTML code. Examples:… Read More
Given an array arr[] of N integers and two numbers K and S, the task is to print all the subsquence of length K with… Read More