#面试刷题
该标签下的全部文章。
Maximum Gap
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
Median of Two Sorted Array
对于含有n个数的数组,若n为奇数,则中位数array[n/2+1],若n为偶数,则中位数为 (array[n/2] + array[n/2+1]) / 2。所以我们当前的目标是设计一种算法能够返回第k大的元素。
Find Minimum in Rotated Sorted Array
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
Nuts & Bolts Problem
Given a set of n nuts of different sizes and n bolts of different sizes.
Search 2D matrix
Check if an element is in a M x N matrix, each row and column of which is sorted.
Search Insert Position
Given a sorted array and a target value, return the index if the target is found.