# Tag Archives: data structure

## 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 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 »

## Sort an Array in Wave Form

Sort an Array in Wave Form In this post we learn how to sort an array in a wave like array ,namely  a1>=a2<=a3>=a4 and so on. How to Sort an Array in Wave Form Problem Statement: Given an unsorted array of integers, we need to sort the array into a wave like array. An array… Read More »

## Alternating merge of two linked lists

Alternating merge of two linked lists Problem statement for alternating merge of two linked lists: Given two singly linked lists, you have to merge two linked lists alternatively. Alternating merge of two linked lists Examples: Consider two singly linked lists where List 1 has lesser nodes: 1-> 8-> 3-> 7-> NULL 5-> 3-> 9-> 13->… Read More »

## Sort linked list whose alternate nodes are in ascending and descending order

Sort list whose alternate nodes are in ascending and descending order without using sorting techniques Problem statement to sort list whose alternate nodes are in ascending and descending order: Given is a singly linked list whose alternate nodes are sorted in ascending and descending order i.e. nodes at odd positions form an ascending ordered linked list… Read More »

## Find Pythagorean Triplet in an Array

Find Pythagorean Triplet in an Array In this post we deal with the problem of finding a pythagorean triplet in the given array. How to Find Pythagorean Triplet in an Array Problem Statement: Given an array of n integers , we need to write a function that returns true if any  elements of the array… Read More »