## Count occurrences of a number in a sorted array with duplicates

Given a sorted array of integers containing duplicates, count occurrences of a number provided. If the element is not found in the array, report that as well.

Coding made easy

Given a sorted array of integers containing duplicates, count occurrences of a number provided. If the element is not found in the array, report that as well.

Given a sorted array of integers, find index of first or last occurrence of a given number. If the element is not found in the array, report that as well.

Given a circular sorted array of integers, search an element in it. Assume there are no duplicates in the array and the rotation is in anti-clockwise direction.

Given a circularly sorted array of integers, find the number of times the array is rotated. Assume there are no duplicates in the array and the rotation is in anti-clockwise direction.

Given a sorted array of integers and a target value, find out if a target exists in the array or not in O(log(n)) time. If target exists in the array, print index of it.

Given a sorted array of integers and a target, find out if a target exists in the array or not using interpolation search. If target exists in the array, print index of it.

Given a sorted array of integers and a target value, find out if a target exists in the array or not in O(log(n)) time using Binary Search Algorithm in C and Java. If target exists in the array, print index of it.

Given an array, find the number of inversions of it. If (i < j) and (A[i] > A[j]) then the pair (i, j) is called an inversion of an array A. We need to count all such pairs in the array.

In this article, hybrid of Quick Sort algorithm with Insertion Sort is discussed to achieve better performance.

Write iterative version of recursive Quicksort algorithm.

Given an array of integers, sort it using quicksort algorithm. Quicksort is an efficient in-place sorting algorithm, which usually performs about two to three times faster than merge sort and heapsort when implemented well.

Given an array of integers, sort it using merge sort algorithm. Merge sort is an efficient in-place sorting algorithm which produces a stable sort, which means that if two elements have the same value, they holds same relative position in the output as they did in the input.