Tag Archives: interview preparation for Arrays

Find minimum number of merge operations to make an array palindrome

Find minimum number of merge operations to make an array palindrome In this post we try to convert a given array into a palindrome by using minimum number of merge operations. Find minimum number of merge operations to make an array palindrome Given an array of positive integers. We need to make the given array… Read More »

Find position of an element in a sorted array of infinite numbers

Find position of an element in a sorted array of infinite numbers In this post we deal with the problem of finding position of an element in a given array which is sorted and has infinite numbers. Find position of an element in a sorted array of infinite numbers Problem Statement Given a sorted array… Read More »

Arrange elements of given array to form largest number

Arrange elements of given array to form largest number In this post we learn how to form the largest number from all the given elements of the input array. Arrange elements of given array to form largest number Problem Statement: Given an array of numbers,we need to arrange them in a way that yields the… Read More »

Rearrange Positive and Negative numbers in an array

Rearrange Positive and Negative numbers in an array In this post we solve the problem of rearranging positive and negative elements of an array such that they are placed alternatively in the same array. Rearrange Positive and Negative numbers in an array Problem Statement Given array contains both positive and negative numbers in random order.… Read More »

Construct an array from it’s pair sum array

Construct an array from it’s pair sum array In this post we deal with the problem of constructing the original array from the array in which the sum of all pairs that can be made from the input array are given. Construct an array from it’s pair sum array Problem Statement: Given a pair-sum array… Read More »

Find number of pairs(x,y) in an array such that x^y > y^x

Find number of pairs(x,y) in an array such that xy > yx In this post we find solution to the problem of finding number of pairs in the given array such that they satisfy the condition that xy > yx. Find number of pairs(x,y) in an array such that xy > yx Problem Statement : Given… Read More »

Delete an Array Element(using one and two traversals)

Delete an Array Element In this post we deal with the common problem of deleting an element fro the array using not only two but one traversal too. Delete an Array Element Problem Statement: Given an array of n integers ,we need to delete a given element of the array. We can delete an array… Read More »

Print All Distinct Elements of the given Array

Print All Distinct Elements of the given Array In this post we deal with the problem of finding all the elements in the array which are not repetitive,that is they appear only once and printing them. Print All Distinct Elements of the given Array Problem Statement: Given an integer array, we need to print all… Read More »

Smallest Subarray with sum greater than a given value

Smallest Subarray with sum greater than a given value In this post we deal with the problem of finding the smallest subarray with sum greater than a given value from the given input array. Smallest Subarray with sum greater than  a given value Problem Statement: Given an array of n integers and a value ‘x’… Read More »

Replace every array element by multiplication of previous and next

Replace every array element by multiplication of previous and next In this post we discuss the problem of replacing every array element by multiplication of previous and next elements. How to Replace every array element by multiplication of previous and next Problem Statement: Given an array of integers, we need to update every element with… Read More »