Hard Problems on Array Searching
- Majority Element
- Number of unique triplets whose XOR is zero
- Find position of an element in a sorted array of infinite numbers
- Find four elements that sum to a given value
- Search an element in an unsorted array using minimum number of comparisons
- k-th missing element in sorted array
- Median of two sorted arrays with different sizes in O(log(min(n, m)))
- Find number of pairs in an array such that their XOR is 0
- Closest numbers from a list of unsorted integers
- Minimum product subset of an array
- Maximum difference between two subsets of m elements
- Find k maximum elements of array in original order
- Number of local extrema in an array
Quick Links:
- ‘Practice Problems’ on Arrays
- ‘Quizzes’ on Arrays
- ‘Video Tutorials’ on Arrays
Searching in Array
Searching is one of the most common operations performed in an array. Array searching can be defined as the operation of finding a particular element or a group of elements in the array.
There are several searching algorithms. The most commonly used among them are:
- Linear Search
- Binary Search
- Ternary Search