# Category: Array

## Find a number in an array having least difference with the given number

Problem: Find a number in the sorted array having least difference with the given number. You might have come across searching a number in a given array. In this …

## Find max and min in array in Java using minimum number of comparisons

Problem: Find max and min in array of integers with minimum number of comparisons. The array is unsorted.   Solution: Efficiency is heart of any algorithm. Solving a problem …

## Find the maximum difference in an array

Problem: Given an array arr, find the maximum j – i such that arr > arr. We have to find the maximum difference in an array. Solution: We will …

## Find the equilibrium position of the array

Problem: Write a program to find the equilibrium position of the array. Ex: given an array: 1,2,3,4,5,6,7,8       equilibrium position should be 5(element 6) i.e  sum of numbers before …

## Frequency of elements in array

Problem: Find frequency of elements in an array of integers. Count number of occurrences of an element in an array. We have to find out frequency of each element in …