Skip to content

Category Archives: Algorithms

Given an array of arr[] of N integers, the task is to find the minimum number of moves to sort the array in non-decreasing order… Read More
Given a directed binary tree of N nodes whose edges are directed from the parent to the child, the task is to count the number… Read More
Given an array A[] having N non-negative integers, find a pair of indices i and j such that the absolute difference between them is same… Read More
Given an array arr[], the task is to find the minimum number of deletion operations required such that: The newly created array should have an… Read More
Given a binary array arr[] of size N, and an integer K, the task is to calculate the number of ways to partition the array… Read More
Given an array arr[] of size N and an integer K, the task is to find the minimum operations such that no variable is divisible… Read More
Given a tree of N vertices, the task is to find the number of pairs of vertices such that the distance between them is even… Read More
Given a binary string S of length N, consisting of 0s and 1s. The task is to count the number of triplet (i, j, k)… Read More
Given an array arr[] of size N, the task is to check if the array elements can be rearranged in a way such that the… Read More
Given an array arr[] of size N, the task is to minimize the array sum after replacing array elements with positive integers in a way… Read More
Given a non-negative integer N, the task is to generate an array such that if any two elements of that array are replaced by their… Read More
Given an array arr[] of size N and an integer K, denoting the maximum value an array element can have, the task is to check… Read More
Given an array arr[] containing N integers, the task is to check whether the array is monotonic or not (monotonic means either the array is… Read More
Given a singly linked list, the task is to Count the pairs of nodes with greater Bitwise AND than Bitwise XOR. Examples: Input: list: 1->4->2->6->3Output:… Read More
Given a Non-Negative integer N, denoting the first 2N positive integers where consecutive integers starting from 1 are paired with each other, the task is… Read More

Start Your Coding Journey Now!