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
Greedy
2.1K+ articles
Sorting
1.8K+ articles
Searching
1.7K+ articles
subarray
658+ articles
array-rearrange
470+ posts
Recent Articles
Popular Articles
Check if it is possible to sort the array without swapping adjacent elements
Last Updated: 09 April 2024
Given an array arr[] of size N, check if it is possible to sort arr[] without swapping adjacent elements. In other words, check if it is possible to sort arr[] by swapping...
read more
Arrays
Sorting
array-rearrange
DSA
Shift the elements between two arrays in Z form
Last Updated: 11 September 2023
Given two arrays arr1[] and arr2[] both of size N, the task is to shift each element of the cell in Z form such that arr2[0] is in arr1[0], arr1[0] is in arr2[1], arr2[1] ...
read more
Arrays
array-rearrange
Arrays
DSA
Construction of multiple AP Arrays
Last Updated: 19 October 2023
Given an array A[] of N integers, the task is to check if it is possible to construct several arrays (at least one) using all the elements of the array A[] such that in ea...
read more
Arrays
array-rearrange
DSA
Modify Array by modifying adjacent equal elements
Last Updated: 14 December 2022
Given an array arr[] of size N of positive integers. The task is to rearrange the array after applying the conditions given below:If arr[i] and arr[i+1] are equal then mul...
read more
Arrays
Technical Scripter
array-rearrange
Technical Scripter 2022
DSA
Maximize the Median of Array formed from adjacent maximum of a rearrangement
Last Updated: 24 March 2023
You are given X[] of length 2*N, Where N will always be odd, the task is to construct an array Y[] of length N from a rearrangement of X[] such that Y[]'s element is equal...
read more
Arrays
Sorting
Technical Scripter
array-rearrange
Technical Scripter 2022
DSA
Rearrange Array such that adjacent difference is odd
Last Updated: 01 December 2022
Given an arr[] containing distinct positive integers of length N(2 ≤ N), the task is to rearrange the array elements in such a way that each element has an odd absolute di...
read more
Arrays
Technical Scripter
array-rearrange
Technical Scripter 2022
DSA
Lexicographically smallest permutation where no element is in original position
Last Updated: 09 November 2023
Given a permutation of first N positive integers, the task is to form the lexicographically smallest permutation such that the new permutation does not have any element wh...
read more
Arrays
Greedy
permutation
array-rearrange
DSA
Rearrange given Array such that all set bit positions have higher value than others
Last Updated: 09 May 2024
Given an array B1[] and a binary array B2[] each of size N, the task is to rearrange array B1[] in a way such that for all setbit position i of B2[] the value of B1[i] wil...
read more
Arrays
Bit Magic
Mathematical
array-rearrange
DSA
Maximise distance by rearranging all duplicates at same distance in given Array
Last Updated: 25 February 2022
Given an array arr[] of N integers. Arrange the array in a way such that the minimum distance among all pairs of same elements is maximum among all possible arrangements. ...
read more
Arrays
Greedy
Mathematical
array-rearrange
frequency-counting
DSA
Rearrange given Array such that each element raised to its index is odd
Last Updated: 24 August 2023
Given an array arr of length N, the task is to rearrange the elements of given array such that for each element, its bitwise XOR with its index is an odd value. If no rear...
read more
Arrays
Bitwise-XOR
array-rearrange
Geeks-Premier-League-2022
Geeks Premier League
DSA
Rearrange given Array by splitting in half and inserting second half in reverse at alternate position
Last Updated: 10 March 2022
Given an array arr[] of even length N, the task is to perform the following operations on the given array:Split the given array in half.Insert the second half in reverse o...
read more
Arrays
array-rearrange
Reverse
partition
DSA
C++ Program to Find Mth element after K Right Rotations of an Array
Last Updated: 14 September 2023
Given non-negative integers K, M, and an array arr[ ] consisting of N elements, the task is to find the Mth element of the array after K right rotations.Examples:Input: ar...
read more
Arrays
Greedy
Pattern Searching
Mathematical
rotation
array-rearrange
C++
C++ Programs
DSA
Find Mth element after K Right Rotations of an Array
Last Updated: 06 February 2024
Given non-negative integers K, M, and an array arr[ ] consisting of N elements, the task is to find the Mth element of the array after K right rotations.Examples:Input: ar...
read more
Arrays
Java
Greedy
Pattern Searching
Mathematical
rotation
array-rearrange
Java Programs
DSA
Python3 Program to Find Mth element after K Right Rotations of an Array
Last Updated: 06 September 2024
[GFGTABS] Python3 # Python3 program to implement# the above approach# Function to return Mth element of# array after k right rotationsdef getFirstElement(a, ...
read more
Arrays
Greedy
Pattern Searching
Mathematical
Python
rotation
array-rearrange
Python Programs
DSA
Javascript Program to Find Mth element after K Right Rotations of an Array
Last Updated: 21 April 2023
Given non-negative integers K, M, and an array arr[ ] consisting of N elements, the task is to find the Mth element of the array after K right rotations.Examples:Input: ar...
read more
Arrays
Greedy
Pattern Searching
Mathematical
rotation
array-rearrange
Web Technologies
JavaScript
DSA
1
2
3
4
...
32
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 !