自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Jin_Kwok的博客

让时间掷地有声

  • 博客(35)
  • 资源 (1)
  • 收藏
  • 关注

原创 【LeetCode】109. Convert Sorted List to Binary Search Tree 解法及注释,分治,递归

109. Convert Sorted List to Binary Search Tree  Total Accepted: 68081 Total Submissions: 224585 Difficulty: MediumGiven a singly linked list where elements are sorted in ascending order, con

2016-04-16 11:01:55 900

原创 【LeetCode】108. Convert Sorted Array to Binary Search Tree 解法及注释,分治法,递归

108. Convert Sorted Array to Binary Search TreeTotal Accepted: 73365 Total Submissions: 197776 Difficulty: MediumGiven an array where elements are sorted in ascending order, convert it to

2016-04-15 21:53:21 752

原创 【LeetCode】104. Maximum Depth of Binary Tree 解法及注释,递归,深度搜索

104. Maximum Depth of Binary TreeTotal Accepted: 137961 Total Submissions: 289093 Difficulty: EasyGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes

2016-04-15 17:46:28 1057

原创 【LeetCode】101. Symmetric Tree 中序遍历,分支遍历,二叉树

101. Symmetric TreeTotal Accepted: 103742 Total Submissions: 306773 Difficulty: EasyGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For

2016-04-15 16:21:50 1270 2

原创 【LeetCode】99. Recover Binary Search Tree 分析、解法、注释、中序遍历、递归

99. Recover Binary Search TreeTotal Accepted: 50739 Total Submissions: 192395 Difficulty: HardTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without

2016-04-15 10:27:10 1733

原创 【LeetCode】98. Validate Binary Search Tree 解法,中序遍历,搜索二叉树合法性

98. Validate Binary Search TreeTotal Accepted: 90083 Total Submissions: 430775 Difficulty: MediumGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST

2016-04-14 20:41:54 1053

原创 【LeetCode】96. Unique Binary Search Trees 解法及注释

96. Unique Binary Search TreesTotal Accepted: 80679 Total Submissions: 216054 Difficulty: MediumGiven n, how many structurally unique BST's (binary search trees) that store values 1...n?

2016-04-14 16:34:05 1429 1

原创 【LeetCode】94. Binary Tree Inorder Traversal 解法及注释

94. Binary Tree Inorder TraversalTotal Accepted: 119866 Total Submissions: 303779 Difficulty: MediumGiven a binary tree, return the inorder traversal of its nodes' values.For example

2016-04-13 23:12:25 656

原创 【LeetCode】92. Reverse Linked List II 解法及注释

92. Reverse Linked List IITotal Accepted: 69222 Total Submissions: 249393 Difficulty: MediumReverse a linked list from position m to n. Do it in-place and in one-pass.For example:G

2016-04-13 22:23:51 707

原创 【LeetCode】90. Subsets II解法及注释

90. Subsets IITotal Accepted: 65104 Total Submissions: 214320 Difficulty: MediumGiven a collection of integers that might contain duplicates, nums, return all possible subsets.Note:E

2016-04-12 23:05:06 1295

原创 【LeetCode】89. Gray Code解法及注释

89. Gray CodeTotal Accepted: 58433 Total Submissions: 161645 Difficulty: MediumThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non

2016-04-12 20:02:10 1484

原创 【LeetCode】87. Scramble String解法及注释

87. Scramble StringTotal Accepted: 44881 Total Submissions: 170059 Difficulty: HardGiven a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recurs

2016-04-12 19:48:04 3833

原创 【LeetCode】84. Largest Rectangle in Histogram 解法及注释

84. Largest Rectangle in HistogramTotal Accepted: 57808 Total Submissions: 239940 Difficulty: HardGiven n non-negative integers representing the histogram's bar height where the width of

2016-04-12 10:14:53 930

原创 【LeetCode】83. Remove Duplicates from Sorted List

83. Remove Duplicates from Sorted ListTotal Accepted: 111368 Total Submissions: 304182 Difficulty: EasyGiven a sorted linked list, delete all duplicates such that each element appear onl

2016-04-11 21:27:44 416

原创 【LeetCode】80. Remove Duplicates from Sorted Array II解法及注释

80. Remove Duplicates from Sorted Array IITotal Accepted: 71844 Total Submissions: 220521 Difficulty: MediumFollow up for "Remove Duplicates":What if duplicates are allowed at most twi

2016-04-11 00:12:09 553

原创 【LeetCode】77. Combinations,DFS的变形应用

77. CombinationsTotal Accepted: 72222 Total Submissions: 212130 Difficulty: MediumGiven two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,

2016-04-10 19:53:34 754

原创 【LeetCode】76. Minimum Window Substring

76. Minimum Window SubstringGiven a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODEBANC"T

2016-04-10 14:46:54 462

原创 【LeetCode】75. Sort Colors解法及注释

75. Sort ColorsGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we

2016-04-09 15:57:56 786

原创 【LeetCode】73. Set Matrix Zeroes解法及注释

73. Set Matrix ZeroesGiven a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.【分析】    这个题本身不难,如果不考虑常量空间的限制,很容易想到一个思路:首先遍历矩阵所有元素,用一个数组记录出现0的行列下标,然后循环将对应的行列

2016-04-09 12:08:23 1059

原创 【LeetCode】70. Climbing Stairs

70. Climbing StairsYou are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?【分析

2016-04-09 10:08:47 342

原创 【LeetCode】69. Sqrt(x)解法及注释

69. Sqrt(x)Implement int sqrt(int x).Compute and return the square root of x.【分析】    对于一个正整数x,我们知道它的平方根不可能超过x/2,因此,基于此思路我们可以遍历[0  x/2]之间的所有正整数,将它们呢的平方与x比较,如果相等或者大于前者小于后者,即找到x的平方根(整数部

2016-04-08 23:28:01 1262

原创 【LeetCode】66. Plus One

66. Plus OneGiven a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.【分

2016-04-08 21:26:48 361

原创 【LeetCode】62. Unique Paths解法及注释

62. Unique PathsA robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot i

2016-04-08 11:50:50 718

原创 【LeetCode】61. Rotate List解法及分析

61. Rotate ListGiven a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.【分析】     这

2016-04-07 23:41:55 791

原创 【LeetCode】56. Merge Intervals

56. Merge IntervalsGiven a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].【分析】   本题旨在合并区间,给定的区间

2016-04-07 22:02:00 546

原创 【LeetCode】53. Maximum Subarray

53. Maximum SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contigu

2016-04-07 19:27:16 421

原创 【LeetCode】51. N-Queens

51. N-QueensThe n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the

2016-04-07 17:09:27 869

原创 【LeetCode】50. Pow(x, n)解法及注释

50. Pow(x, n) Total Accepted: 87046 Total Submissions: 312150 Difficulty: MediumImplement pow(x, n).【分析】此题意在实现c++库函数Pow(double x, int n),即求解x的n次幂。此题的解题思路比较简单:将n次幂“折半”,即:Pow(x,n)=Pow(x,n/2)

2016-04-06 23:27:10 1400

原创 【LeetCode】49. Group Anagrams解法及注释

49. Group Anagrams Total Accepted: 71543 Total Submissions: 262846 Difficulty: MediumGiven an array of strings, group anagrams together.For example, given: ["eat", "tea", "tan", "ate", "na

2016-04-06 21:07:13 1088

原创 【LeetCode】48. Rotate Image解法及注释

48. Rotate ImageYou are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?【分析】此题要求将一个二维矩阵旋转90度,官方认证的难度是“Mediu

2016-04-06 10:02:36 1050

原创 【LeetCode】46. Permutations 的两种解法及注释、分析

46. Permutations Given a collection of distinct numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3

2016-04-05 22:38:56 1046

原创 【LeetCode】44. Wildcard Matching解法及注释

44. Wildcard MatchingImplement wildcard pattern matching with support for '?' and '*'.1. '?' Matches any single character.2. '*' Matches any sequence of characters (including the empty sequence)

2016-04-05 10:32:52 822

原创 【LeetCode】42. Trapping Rain Water算法及注释

42. Trapping Rain WaterTotal Accepted: 63251 Total Submissions: 197568 Difficulty: HardGiven n non-negative integers representing an elevation map where the width of each bar is

2016-04-03 23:56:05 779

原创 【LeetCode】41. First Missing Positive的解法及注释

41. First Missing PositiveMy SubmissionsQuestionEditorial SolutionTotal Accepted: 61575 Total Submissions: 259854 Difficulty: HardGiven an unsorted integer array, find th

2016-04-01 20:35:00 1324

原创 【LeetCode】39. Combination Sum & 40. Combination Sum II分析及解法&DFS

39. Combination SumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may

2016-04-01 16:07:37 458

SimHei-config.zip

SimHei.ttf 字体文件,适用于Mac OX,Linux等系统平台。特别适用于 matplotlib 绘图中文标签报错的问题

2020-05-28

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除