# Category Archives: Algorithms

Given a 0-based n x n integer matrix where grid[x][y] represents the height of the blocks in row x and column y. You can increaseâ€¦ Read More
Given an array, arr[] of size N, and an integer K, the task is to check if it is possible to form a permutation fromâ€¦ Read More
Sorting is defined as the process of arranging a collection of data elements in a specific order, usually in ascending or descending order based onâ€¦ Read More
Recursion is defined as a process which calls itself directly or indirectly and the corresponding function is called a recursive function. Properties of Recursion: Recursionâ€¦ Read More
Linear search is defined as the searching algorithm where the list or data set is traversed from one end to find the desired value. Linearâ€¦ Read More
Given arrays A[] and B[] of size N, the task is to count ways to form an array of size N such that the newâ€¦ Read More
Invariants and Monovariants are the two properties of mathematics and computer science that describe objects and algorithms. Invariants and mono variants are important mathematical conceptsâ€¦ Read More
Block sort is a sorting algorithm that sorts an array by dividing it into blocks of fixed size, sorting each block individually, and then mergingâ€¦ Read More
Smooth sort is a sorting algorithm that was introduced by Edsger Dijkstra. It is another version of heapsort that is designed to minimize the numberâ€¦ Read More
Given a positive integer array arr[] of size N, the task is to print the longest non-empty subarray whose bitwise AND is maximum in theâ€¦ Read More
Given a 2D array span[][] of length N which contains spans [L, R] (0 â‰¤ L â‰¤ R â‰¤ 109), the task is to mergeâ€¦ Read More
Given two walls A, B with M, and N hooks respectively. You are also given K ropes. By using one rope you can connect oneâ€¦ Read More
There is a carpet of size A * B [length * breadth]. Given a box of size C * D, the task is to fitâ€¦ Read More
What is Dijkstraâ€™s Algorithm? Dijkstraâ€™s algorithm is a popular algorithms for solving many single-source shortest path problems having non-negative edge weight in the graphs i.e.,â€¦ Read More
Given n stones and array heights[] and Geek is standing at stone 1 and can jump to one of the following: Stone i+1, i+2, …â€¦ Read More