Courses
Tutorials
Interview Prep
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.5K+ articles
Misc
7.7K+ articles
Mathematical
5.1K+ articles
Arrays
4.2K+ articles
Strings
2.1K+ articles
Greedy
1.4K+ articles
Searching
1.0K+ articles
Hash
831+ articles
array-rearrange
470+ articles
Sorting Quiz
49 posts
Recent Articles
C++ Program to Rearrange array such that arr[i] >= arr[j] if i is even and arr[i]<=arr[j] if i is odd and j < i
Last Updated: 23 July 2025
Given an array of n elements. Our task is to write a program to rearrange the array such that elements at even positions are greater than all elements before it and elemen...
read more
C++
Sorting Quiz
array-rearrange
Java Program to Rearrange array such that arr[i] >= arr[j] if i is even and arr[i]<=arr[j] if i is odd and j < i
Last Updated: 23 July 2025
Given an array of n elements. Our task is to write a program to rearrange the array such that elements at even positions are greater than all elements before it and elemen...
read more
Java
Sorting Quiz
array-rearrange
Python3 Program to Rearrange array such that arr[i] >= arr[j] if i is even and arr[i]<=arr[j] if i is odd and j < i
Last Updated: 23 July 2025
Given an array of n elements. Our task is to write a program to rearrange the array such that elements at even positions are greater than all elements before it and elemen...
read more
Python
Sorting Quiz
array-rearrange
PHP Program to Rearrange Array Such That arr[i] >= arr[j] if i is Even and arr[i]<=arr[j] if i is Odd and j < i
Last Updated: 23 July 2025
Given an array of n elements. Our task is to write a program to rearrange the array such that elements at even positions are greater than all elements before it and elemen...
read more
PHP
Sorting Quiz
array-rearrange
Javascript Program to Rearrange array such that arr[i] >= arr[j] if i is even and arr[i]<=arr[j] if i is odd and j < i
Last Updated: 23 July 2025
Given an array of n elements. Our task is to write a program to rearrange the array such that elements at even positions are greater than all elements before it and elemen...
read more
JavaScript
Sorting Quiz
array-rearrange
Gnome Sort Visualizer using JavaScript
Last Updated: 23 July 2025
In this article, we are going to learn Gnome sort Visualizer using javascript, Gnome Sort also called Stupid sort, is based on the concept of a Garden Gnome sorting his fl...
read more
JavaScript
Sorting Quiz
javascript-math
JavaScript-Methods
JavaScript-Questions
Sorting boundary elements of a matrix
Last Updated: 15 July 2025
Given a matrix mat[][] of size M*N, the task is to sort only the border elements of the matrix in the clockwise direction and print the matrix after sorting again.Examples...
read more
DSA
Sorting Quiz
Python | Sorting string using order defined by another string
Last Updated: 27 September 2022
Given two strings (of lowercase letters), a pattern and a string. The task is to sort string according to the order defined by pattern and return the reverse of it. It may...
read more
Python
Sorting Quiz
python-lambda
Python string-programs
Python-sort
Check if the array can be sorted using swaps between given indices only
Last Updated: 25 November 2023
Given an array arr[] of size N consisting of distinct integers from range [0, N - 1] arranged in a random order. Also given a few pairs where each pair denotes the indices...
read more
DSA
Sorting Quiz
graph-connectivity
Marketing
Find a pair from the given array with maximum nCr value
Last Updated: 07 May 2025
Given an array arr[] of n positive integers. The task is to find elements arr[i] and arr[j] from the array such that arr[i]Carr[j] is maximum possible. In case of more tha...
read more
Mathematical
Combinatorial
Advanced Data Structure
DSA
Sorting Quiz
Distinct state codes that appear in a string as contiguous sub-strings
Last Updated: 11 July 2025
Every state is represented by string of length 2. For example DL is used for Delhi, HP for Himachal Pradesh, UP for Uttar Pradesh, PB for Punjab etc.Given a string str con...
read more
DSA
Sorting Quiz
cpp-set
substring
Schedule elevator to reduce the total time taken
Last Updated: 01 June 2022
Given an integer k and an array arr[] representing the destination floors for N people waiting currently at the ground floor and k is the capacity of the elevator i.e. max...
read more
DSA
Sorting Quiz
Arrays
Select numbers in such way to maximize the amount of money
Last Updated: 16 June 2022
Given two arrays A1 and A2 of N numbers. There are two people A and B who select numbers out of N. If A selects i-th number, then he will be paid A1[i] amount of money and...
read more
DSA
Sorting Quiz
Minimize the sum of squares of sum of N/2 paired formed by N numbers
Last Updated: 16 September 2022
Given N numbers(N is an even number). Divide the N numbers into N/2 pairs in such a way that the sum of squares of the sum of numbers in pairs is minimal. The task is to p...
read more
DSA
Sorting Quiz
Array Manipulation and Sum
Last Updated: 16 September 2022
Given an array arr[] of N integers and an integer S. The task is to find an element K in the array such that if all the elements from the array K are made equal to K then...
read more
DSA
Sorting Quiz
1
2
3
4