What is Queue? Queue is an abstract data type that is open at both ends. One end is always used to insert data (enqueue) which… Read More
Category Archives: Data Structures
Stack is basically a restrictive array that uses LIFO Property. We use pop() and push() Operations to delete and insert elements into the stack respectively.… Read More
Given a string S and an array roll[] where roll[i] represents incrementing first roll[i] characters in the string, the task is to increment all the… Read More
Given an undirected graph with V vertices and E edges and a node X, The task is to find the level of node X in… Read More
Given the adjacency list of a bidirectional graph. The task is to copy/clone the adjacency list for each vertex and return a new list for… Read More
Given an arr[] of binary digits. Consider two players X and Y are playing a game where in one move a player can remove any… Read More
Printing Boundary Elements of a Matrix. Given a matrix of size n x m. Print the boundary elements of the matrix. Boundary elements are those… Read More
With advancement, it’s important to walk with the trend. As you can see, the world is moving more towards IT, everyone wants to upskill themselves… Read More
You are given X[] of length 2*N, Where N will always be odd, the task is to construct an array Y[] of length N from… Read More
Given N points moving along the X axis to the right whose initial position and speed are given in two arrays X[] (sorted in increasing… Read More
Given the cost[] and profit[] of N stocks and K tickets, the task is to find the maximum total profit that can be obtained from… Read More
Given an array arr[] of size N, the task is to find the maximum number of subsets the array can be split such that the… Read More
Given an integer array arr[] of size N, the task is to generate a new array by replacing ith element with its immediate right smaller… Read More
Given an array arr[] of N integers, the task is to find the element which is left at last after performing the following operation N… Read More