The Wayback Machine - https://web.archive.org/web/20240622063231/https://www.geeksforgeeks.org/basic/constructive-algorithms/
Constructive Algorithms - Basic Articles
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 an integer N where 1 ? N ? 105, the task is to find the number of positive integers less than or equal toâ€Ķ Read More
Given two strings of equal lengths str1 and str2 consist of characters ‘a’ and ‘b’ only. The following operations can be performed on str1:  Anyâ€Ķ Read More
Given an array Arr[]. The task is to count the number of elements Arr[i] in the given array such that one or more smaller elementsâ€Ķ Read More
Given two sides of a triangle s1 and s2, the task is to find the minimum and maximum possible length of the third side ofâ€Ķ Read More
Given a total amount of N and unlimited number of coins worth 1,  10 and 25 currency coins. Find out the minimum number of coins you need to useâ€Ķ Read More
Given an integer N containing the digit 4 at least once. The task is to divide the number into two parts x1 and x2 suchâ€Ķ Read More
Given a binary array of N numbers. The task is to find the smallest index such that there are either no 1’s or 0’s toâ€Ķ Read More
Given four integers a, b, c and d which signifies the number of four types of brackets.   “((“ “()” “)(“ “))” The task is toâ€Ķ Read More
Given an array of N including positive and negative numbers only. The task is to find the length of the longest alternating (means negative-positive-negative orâ€Ķ Read More
Given two string A and B which represents two integers, the task is to print the maximized value of A after replacing 0 or moreâ€Ķ Read More
Given a string str and an integer k. The task is to count the occurrences of sub-strings of length k that consist of the sameâ€Ķ Read More
Given an array arr[] and an integer K, the task is to find whether the array can be divided into two sub-arrays such that theâ€Ķ Read More
Given a linked list. The task is to change the value of the previous and next node of a node to 0 if the currentâ€Ķ Read More
Given the total number of Legs and Head of Rabbits and Pigeons. The task is to calculate the number of Rabbits and Pigeons. Examples:  Input:â€Ķ Read More
Given N magnets are kept in a row one after another, either with a negative pole on the left and a positive pole on theâ€Ķ Read More
Given a number N. The task is to count the minimum number of digits to be removed from the number so that no two consecutiveâ€Ķ Read More
Given two arrays of positive and distinct integers. The task is to find a pair from the two arrays with maximum sum. Note: The pairâ€Ķ Read More
Given a, b and c which are part of the equation x = b * ( sumdigits(x) ^ a ) + c.Where sumdigits(x) determines theâ€Ķ Read More
Given two bracket sequences S1 and S2 consisting of ‘(‘ and ‘)’. The task is to check if the string obtained by concatenating both theâ€Ķ Read More