
leetcode
文章平均质量分 95
squanchs
zhizhiweizhizhi
展开
-
leetcode easy
3.Longest Substring Without Repeating Characters案例"google"这里是引用滑动(保存无重复字符的)窗口, 窗口有left 和 当前遍历的脚标(勇往直前!)若遇到一个以前遇见过的,比如第二个o原创 2018-12-19 22:11:53 · 407 阅读 · 0 评论 -
leetcode Medium
Add Two NumbersExample: Input: (2 -> 4 -> 3) + (5 -> 6 -> 4) Output: 7 -&a原创 2019-01-04 10:25:30 · 714 阅读 · 0 评论 -
Medium
3.Longest Substring Without Repeating Characters 案例google滑动(保存无重复字符的)窗口, 窗口有left 和 当前遍历的脚标(勇往直前!) 若遇到一个以前遇见过的,比如第二个o 那么left就赋值为上一个o的脚标1。 同时用现在的脚标将o的脚标更新。 o->2 .然后长度就是 当前 脚标-leftpubl...原创 2018-12-19 11:54:17 · 1147 阅读 · 0 评论 -
排序
分治法解决归并排序分治法:将两个已经排序好的数组揉并成一个数组,当然是把两个数组从头到尾一一比较,依次进入数组。假设已经存在一个数组,他的左右都已经排序好void m(int[] arr, int L, int M, int R) { //初始化左右数组 int LEFT_SIZE = M - L + 1; int RIGHT_SIZE = R...原创 2019-01-14 13:54:10 · 130 阅读 · 0 评论 -
leetcode hard
[4] Median of Two Sorted Arrays-求两个排序好的数组的中位数(先合并)/ * There are two sorted arrays nums1 and nums2 of size m and n respectively. * * Find the median of the two sorted arrays. The overall run time ...原创 2019-02-18 11:19:45 · 385 阅读 · 0 评论