Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Misc
8.8K+ articles
Mathematical
7.8K+ articles
Arrays
6.5K+ articles
Competitive Programming
3.3K+ articles
Strings
3.3K+ articles
Greedy
2.1K+ articles
Algorithms
2.0K+ articles
Sorting
1.8K+ articles
Constructive Algorithms
215+ posts
Recent Articles
Popular Articles
Construct a square matrix such that the sum of each row and column is odd
Last Updated: 16 January 2024
Given an integer N. Then your task is to output a square matrix of length N using the numbers from the range [1, N2] such that the sum of each row and column is odd.Note: ...
read more
Matrix
Greedy Algorithms
Constructive Algorithms
Geeks Premier League
DSA
Equalize all Array elements by dividing with another Array element
Last Updated: 17 August 2023
Given an array arr[] of N positive integers ( 0). The task is to check if it is possible to make all array elements equal by performing the given operation. Print "Yes" if...
read more
Greedy
Mathematical
Greedy Algorithms
Constructive Algorithms
DSA
C++ Program to Check if it is possible to make array increasing or decreasing by rotating the array
Last Updated: 08 June 2022
Given an array arr[] of N distinct elements, the task is to check if it is possible to make the array increasing or decreasing by rotating the array in any direction.Examp...
read more
Arrays
Mathematical
rotation
C++
C++ Programs
Constructive Algorithms
DSA
Java Program for Check if it is possible to make array increasing or decreasing by rotating the array
Last Updated: 26 May 2022
Given an array arr[] of N distinct elements, the task is to check if it is possible to make the array increasing or decreasing by rotating the array in any direction.Examp...
read more
Arrays
Java
Mathematical
rotation
Java Programs
Constructive Algorithms
DSA
Javascript Program to Check if it is possible to make array increasing or decreasing by rotating the array
Last Updated: 08 June 2022
Given an array arr[] of N distinct elements, the task is to check if it is possible to make the array increasing or decreasing by rotating the array in any direction.Examp...
read more
Arrays
Mathematical
rotation
Web Technologies
JavaScript
Constructive Algorithms
DSA
C++ Program to Swap characters in a String
Last Updated: 18 August 2023
Given a String S of length N, two integers B and C, the task is to traverse characters starting from the beginning, swapping a character with the character after C places ...
read more
Strings
rotation
C++
C++ Programs
Constructive Algorithms
Swap-Program
DSA
Java Program to Swap characters in a String
Last Updated: 06 April 2023
The task at hand involves manipulating a string S of length N, given as input. The string is subjected to a series of B swaps, each performed according to the following pr...
read more
Strings
Java
rotation
Java Programs
Constructive Algorithms
Swap-Program
DSA
Python3 Program for Swap characters in a String
Last Updated: 05 September 2024
Given a String S of length N, two integers B and C, the task is to traverse characters starting from the beginning, swapping a character with the character after C places ...
read more
Strings
Python
rotation
Python Programs
Constructive Algorithms
Swap-Program
DSA
Problem with Single Argument Constructor in C++ and How to solve it
Last Updated: 25 February 2022
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 a constructor allows a...
read more
C++
C++-Constructors
C++ Programs
Constructive Algorithms
Lexicographically smallest string which differs from given strings at exactly K indices
Last Updated: 24 November 2022
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 it differs from the given two strings...
read more
Strings
Algorithms
Greedy
Searching
Mathematical
Competitive Programming
Constructive Algorithms
lexicographic-ordering
strings
DSA
Partition of a set into k subsets with equal sum using BitMask and DP
Last Updated: 26 November 2024
Given an integer array arr[] and an integer k, the task is to check if it is possible to divide the given array into k non-empty subsets of equal sum such that every array...
read more
Arrays
Bit Magic
subset
Dynamic Programming
Mathematical
Recursion
C++
Constructive Algorithms
DSA
Count of indices in an array that satisfy the given condition
Last Updated: 01 March 2022
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] to arr[i - 1] are smaller than arr[i].Exampl...
read more
Arrays
Mathematical
Constructive Algorithms
DSA
Minimum inversions required so that no two adjacent elements are same
Last Updated: 01 March 2022
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 are same. After a single inversion, an...
read more
Arrays
Mathematical
Constructive Algorithms
DSA
Minimum operations required to make the string satisfy the given condition
Last Updated: 09 January 2023
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. In a single operation, any character of...
read more
Strings
Constructive Algorithms
DSA
Reduce every element of the array to it's half retaining the sum zero
Last Updated: 23 July 2022
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 that the total sum remain zero. For every od...
read more
Arrays
Python Programs
Constructive Algorithms
DSA
1
2
3
4
...
15
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !