Skip to content

Tag Archives: array-rearrange

We have an array of the form {a0, a1, a2….., an, b0, b1, b2, …..bn} and our task is to rearrange the same in theform… Read More
Given an array of integers, segregate even and odd numbers in the array. All the even numbers should be present first, and then the odd… Read More
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… Read More
Given an array of elements of length N, ranging from 0 to N – 1. All elements may not be present in the array. If… Read More
Given an array of n numbers. The problem is to move all the 0’s to the end of the array while maintaining the order of… Read More
For a given array of n integers and assume that ‘0’ is an invalid number and all others as a valid number. Convert the array… Read More
Given an array A of n elements, sort the array according to the following relations :     , if i is even.     , if… Read More
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… Read More
Given an array of positive and negative numbers, arrange them such that all negative integers appear before all the positive integers in the array. The… Read More
Given an array of positive and negative numbers, arrange them such that all negative integers appear before all the positive integers in the array without… Read More
Given an array of 2n elements in the following format { a1, a2, a3, a4, ….., an, b1, b2, b3, b4, …., bn }. The… Read More
Given a binary string s and two integers x and y are given. Task is to arrange the given string in such a way so… Read More
Given an array, rearrange the array such that :  If index i is even, arr[i] <= arr[i+1] If index i is odd, arr[i] >= arr[i+1]… Read More
You have been given an array and you have to make a program to convert that array such that positive elements occur at even numbered… Read More
An array contains both positive and negative numbers in random order. Rearrange the array elements so that all negative numbers appear before all positive numbers.… Read More