# Category: Search Algorithms

## Find the element which appears maximum number of times in the array.

Objective: Given an array of integers, write a algorithm to find the element which appears maximum number of times in the array. Example: int [] arrA = {4, 1, 5, 2, 1, 5, 9,...

## Find duplicates in an given array in O(n) time and O(1) extra space.

Objective: Given an array of integers, find out duplicates in it. Example: int [] a = {4, 6, 2, 1, 2, 5}; Output: Array has duplicates : 2 int a [] = {1, 6,...

## Track the Maximum Element in a Stack.

Objective: In a Stack, keep track of maximum value in it. It might be the top element in the stack but once it is poped out, the maximum value should be from the rest...

## Search an Element in a Rotated Sorted Array

Input: Rotated Sorted Array. What is Rotated Sorted Array. A sorted array is rotated around some pivot element. See the Example Below, array is rotated after 6. Approach:

## Find a peak element in a Given Array

Objective : In this article we will discuss an algorithm to Find a peak element in a Given Array. We will see the recursion techniques to solve this problem. Peak Element: peak element is...

## Binary Search

Objective : Write an algorithm to find an element in an sorted array Input: A sorted array, arrA[] and an key Output : Return true if element is found, else false. Approach: The idea...