Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
DSA
22.4k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Greedy
2k+ articles
Sorting
1.7k+ articles
Searching
1.7k+ articles
Hash
1.2k+ articles
Matrix
1.2k+ articles
subarray
640+ articles
rotation
400+ articles
array-rearrange
460+ posts
Popular Articles
Recent Articles
Search insert position of K in a sorted array
Last Updated: 03 March 2025
Given a 0-based sorted arrayarr[] consisting ofndistinct integers and an integerk, the task is to find the index of k, if it is present in t
...read more
Arrays
Binary Search
Searching
array-rearrange
array-traversal-question
DSA
In-Place Algorithm
Last Updated: 29 August 2022
In-place has more than one definition. One strict definition is.An in-place algorithm is an algorithm that does not need an extra space and
...read more
Arrays
Analysis of Algorithms
Sorting
array-rearrange
DSA
Minimum swaps required to bring all elements less than or equal to k together
Last Updated: 17 December 2024
Given an array of n positive integers and a number k. Find the minimum number of swaps required to bring all the numbers less than or equal
...read more
Arrays
array-rearrange
DSA
Similar Topics
DSA
22.4k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Greedy
2k+ articles
Sorting
1.7k+ articles
Searching
1.7k+ articles
Hash
1.2k+ articles
Matrix
1.2k+ articles
subarray
640+ articles
rotation
400+ articles
Rearrange an array such that arr[i] = i
Last Updated: 26 November 2024
Given an array of elements of length n, ranging from 0 to n - 1. All elements may not be present in the array. If the element is not present
...read more
Arrays
Hash
array-rearrange
DSA
Rearrange array such that even positioned are greater than odd
Last Updated: 26 November 2024
Given an array arr[], sort the array according to the following relations:arr[i] = arr[i - 1], if i is even,∀ 1 = i narr[i] = arr[i - 1],
...read more
Arrays
Sorting
array-rearrange
DSA
Even numbers at even index and odd numbers at odd index
Last Updated: 31 March 2023
Given an array of size n containing equal number of odd and even numbers. The problem is to arrange the numbers in such a way that all the e
...read more
Arrays
array-rearrange
DSA
Move all negative numbers to beginning and positive to end with constant extra space
Last Updated: 11 February 2025
Given an array containing both positive and negative numbers in random order. The task is to rearrange the array elements so that all negati
...read more
Arrays
array-rearrange
Quick Sort
two-pointer-algorithm
DSA
Rearrange an array in order - smallest, largest, 2nd smallest, 2nd largest, ..
Last Updated: 21 August 2022
Given an array of integers, the task is to print the array in the order - smallest number, the Largest number, 2nd smallest number, 2nd larg
...read more
Arrays
Sorting
array-rearrange
DSA
Alternative Sorting
Last Updated: 21 August 2022
Given an array of integers, print the array in such a way that the first element is first maximum and second element is first minimum and so
...read more
Arrays
Zoho
Sorting
array-rearrange
DSA
Rearrange an array in maximum minimum form in O(1) extra space
Last Updated: 10 July 2024
Given a sorted array of positive integers, rearrange the array alternately i.e first element should be the maximum value, second minimum val
...read more
Arrays
Zoho
Sorting
Modular Arithmetic
array-rearrange
DSA
Rearrange positive and negative numbers with constant extra space
Last Updated: 09 November 2024
Given an array arr[] of integers, the task is to arrange them such that all negative integers appear before all the positive integers in the
...read more
Sorting
array-rearrange
Insertion Sort
DSA
Convert Array into Zig-Zag fashion
Last Updated: 19 February 2025
Given an array of distinct elements of size N, the task is to rearrange the elements of the array in a zig-zag fashion, i.e., the elements a
...read more
Arrays
Amazon
Paytm
array-rearrange
DSA
Sort an array in wave form
Last Updated: 12 February 2025
Given an unsorted array of integers, sort the array into a wave array. An array arr[0..n-1] is sorted in wave form if: arr[0] = arr[1] = arr
...read more
Arrays
Zoho
FactSet
Sorting
array-rearrange
DSA
Rearrange Array Elements by Sign
Last Updated: 15 February 2025
Given an array arr[] of size n, the task is to rearrange it in alternate positive and negative manner without changing the relative order of
...read more
Arrays
array-rearrange
DSA
Alternate Rearrangement of Positives and Negatives
Last Updated: 12 May 2025
An array contains both positive and negative numbers in random order. Rearrange the array elements so that positive and negative numbers are
...read more
Arrays
Amazon
Paytm
array-rearrange
DSA
1
2
3
4
5
6
7
8
>>
Last
1
2
3
4
5
6
>>
Last
1
2
3
4
>>
Last
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 !