In C++, if a class has a constructor which can be called with a single argument, then this constructor becomes a conversion constructor because such… Read More

# Tag Archives: Constructive Algorithms

Given two strings S1 and S2 of length N and a positive integer K, the task is to find the lexicographically smallest string such that… Read More

Given an integer array arr[] of consisting of N integers, the task is check if it is possible to divide the given array into K… Read More

Given an array arr[] of N positive integers, the task is to find the count of indices i such that all the elements from arr[0]… Read More

Given a binary array arr[] of size N. The task is to find the minimum number of inversions required so that no two adjacent elements… Read More

Given two strings A and B of length N, the task is to check whether the two strings can be made equal by swapping any… Read More

Given a number N, the task is to form N (from 0) by adding 1 or 2 in the minimum number of operations X such… Read More

Given a string str, the task is to make the string start and end at the same character with the minimum number of given operations.… Read More

Given an array arr[] of N integers with total element sum equal to zero. The task is to reduce every element to it’s half such… Read More

Given two string S1 and S2, the task is to check whether both the strings can be made equal by performing the given operation on… Read More

Given two numbers X and Y of the same length, the task is to find the minimum number d that needs to be added to… Read More

Given two integers N and M, where N is the number of friends sitting in a clockwise manner in a circle and M is the… Read More

Given a stack of integers and an integer K, the task is to sort the elements of the given stack using another stack in the… Read More

Given an array arr[] of size N, the task is to check if it is possible to make the array non-decreasing by applying the given… Read More

Given an array arr[] of size N. The task is to find maximum element among N – 1 elements other than arr[i] for each i… Read More