
排序
文章平均质量分 72
忧伤的肚腩
华中科技大学计算机专业在读
展开
-
Leetcode 35. Search Insert Position
参考链接二分查找普通二分查找low < high在这里low<=high退出循环是 low>high , 查找不成功没, low 就是要插入当位置即可class Solution { public int searchInsert(int[] nums, int target) { //二分查找 int n = nums...原创 2018-10-01 20:48:49 · 137 阅读 · 0 评论 -
有序数组
导读如何查找一个无序数组中的最大第k个数如何查找一个无序数组中的最小第k个数如何查找两个有序数组中的第k大数如何查找两个有序数组的中位数如何在两个有序数组中找到第K的元素参考链接情况example:Input : Array 1 - 2 3 6 7 9Array 2 - 1 4 8 10k = 5Output : 6Explanation: The final s...原创 2018-10-05 21:39:46 · 2020 阅读 · 0 评论 -
295. Find Median from Data Stream
题目描述如何求数据流的中位数情况,这个数据流可以随时添加数据,此题要找出数据流的中位数,数据流由无序整数组成,并且数据流是在变化的。数据流顺序是无序的,添加的顺序也是无序,但是求解是中位数的话就要保持有序的状态,所以基本Median is the middle value in an ordered integer list. If the size of the list is even,...原创 2018-11-25 21:28:01 · 182 阅读 · 0 评论 -
34. Find First and Last Position of Element in Sorted Array
描述iven an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the order of O(log n).If the...原创 2018-11-25 16:10:02 · 304 阅读 · 0 评论