自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(33)
  • 收藏
  • 关注

原创 LeetCode 307. Range Sum Query - Mutable(线段树)

题目来源:https://leetcode.com/problems/range-sum-query-mutable/问题描述307.Range Sum Query - MutableMediumGiven an integer arraynums, find the sum of the elements between indicesiandj(i≤j), in...

2019-07-31 12:34:58 336

原创 160. Intersection of Two Linked Lists(链表)

题目来源:https://leetcode.com/problems/intersection-of-two-linked-lists/问题描述160.Intersection of Two Linked ListsEasyWrite a program to find the node at which the intersection of two singly linked...

2019-07-27 17:00:44 92

原创 LeetCode 155. Min Stack

题目来源:https://leetcode.com/problems/min-stack/问题描述155.Min StackEasyDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x ...

2019-07-27 16:47:12 126

原创 LeetCode 154. Find Minimum in Rotated Sorted Array II(二分)

题目来源:https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/问题描述154.Find Minimum in Rotated Sorted Array IIHardSuppose an array sorted in ascending order is rotated at some piv...

2019-07-27 16:07:21 102

原创 LeetCode 421. Maximum XOR of Two Numbers in an Array(字典树)

题目来源:https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/问题描述421.Maximum XOR of Two Numbers in an ArrayMediumGiven anon-emptyarray of numbers, a0, a1, a2, … , an-1, where 0...

2019-07-27 11:16:44 190

原创 LeetCode 300. Longest Increasing Subsequence(动态规划 + 二分查找)

Longest Increasing SubsequenceMediumGiven an unsorted array of integers, find the length of longest increasing subsequence.Example:Input: [10,9,2,5,3,7,101,18]Output: 4Explanation: The longest i...

2019-07-26 10:33:32 397

原创 LeetCode 153. Find Minimum in Rotated Sorted Array(二分)

Find Minimum in Rotated Sorted ArrayMediumSuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).Find ...

2019-07-25 09:46:00 118

原创 LeetCode 152. Maximum Product Subarray(动态规划)

题目来源:https://leetcode.com/problems/maximum-product-subarray/问题描述152.Maximum Product SubarrayMediumGiven an integer arraynums, find the contiguous subarray within an array (containing at leas...

2019-07-24 23:30:49 223

原创 LeetCode 151. Reverse Words in a String

题目来源:https://leetcode.com/problems/reverse-words-in-a-string/问题描述151.Reverse Words in a StringMediumGiven an input string, reverse the string word by word.Example 1:Input: "the sky is blu...

2019-07-24 00:53:43 106

原创 Linux shell 输入/输出重定向

在Linux shell中,可以通过输入/输出重定向的方式将标准输入stdin、标准输出stdout、标准错误输出stderr重定向到文件。下表总结了常用符号:符号释义0标准输入1标准输出2标准错误输出<输入重定向>输出重定向<<输入追加重定向>>输出追加重定向&合并介...

2019-07-23 18:48:13 847

原创 119. Pascal's Triangle II

Pascal’s Triangle IIEasyGiven a non-negative index k where k ≤ 33, return the kth index row of the Pascal’s triangle.Note that the row index starts from 0.题意LeetCode 118. Pascal’s Triangle(杨辉三角)的...

2019-07-22 21:30:18 73

原创 LeetCode 149. Max Points on a Line(哈希)

Max Points on a LineHardGiven n points on a 2D plane, find the maximum number of points that lie on the same straight line.Example 1:Input: [[1,1],[2,2],[3,3]]Output: 3Explanation:^|| ...

2019-07-22 12:37:05 169

原创 LeetCode 118. Pascal's Triangle(杨辉三角)

题目来源:https://leetcode.com/problems/pascals-triangle/问题描述118.Pascal's TriangleEasyGiven a non-negative integernumRows, generate the firstnumRowsof Pascal's triangle.Example:Input: 5...

2019-07-20 19:20:10 127

原创 Mysql命令行结果竖排显示

在Mysql的命令行查询中,当字段较多或者一个字段的值较长以至于一行排布不下时,可以用\G替代原查询命令结尾的分号使得查询的一条记录从原来的横排显示变为竖排显示。例如:SELECT * FROM test.users LIMIT 2;改为SELECT * FROM test.users LIMIT 2\G...

2019-07-19 14:45:52 6146

原创 LeetCode 150. Evaluate Reverse Polish Notation(栈)

Evaluate Reverse Polish NotationMediumEvaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression....

2019-07-19 13:22:02 97

原创 LeetCode 147. Insertion Sort List(插入排序)

Insertion Sort ListMediumSort a linked list using insertion sort.A graphical example of insertion sort. The partial sorted list (black) initially contains only the first element in the list.With e...

2019-07-18 14:03:39 128

原创 LeetCode 146. LRU Cache

LRU CacheMediumDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.get(key) - Get the value (will always be positive) ...

2019-07-17 22:19:15 151

原创 145. Binary Tree Postorder Traversal(二叉树)

题目来源:https://leetcode.com/problems/binary-tree-postorder-traversal/问题描述145.Binary Tree Postorder TraversalHardGiven a binary tree, return thepostordertraversal of its nodes' values.Example...

2019-07-17 00:11:38 124

原创 144. Binary Tree Preorder Traversal(二叉树)

题目来源:https://leetcode.com/problems/binary-tree-preorder-traversal/问题描述144.Binary Tree Preorder TraversalMediumGiven a binary tree, return thepreordertraversal of its nodes' values.Example:...

2019-07-17 00:09:29 132

原创 LeetCode 140. Word Break II(dfs)

题目来源:https://leetcode.com/problems/word-break-ii/问题描述140.Word Break IIHardGiven anon-emptystringsand a dictionarywordDictcontaining a list ofnon-emptywords, add spaces insto constru...

2019-07-13 20:55:03 242

原创 LeetCode 139. Word Break(dfs)

题目来源:https://leetcode.com/problems/word-break/问题描述139.Word BreakMediumGiven anon-emptystringsand a dictionarywordDictcontaining a list ofnon-emptywords, determine ifscan be segmente...

2019-07-13 11:41:56 243 6

原创 LeetCode 142. Linked List Cycle II(快慢指针)

Linked List Cycle IIGiven a linked list, return the node where the cycle begins. If there is no cycle, return null.To represent a cycle in the given linked list, we use an integer pos which represen...

2019-07-12 16:30:51 210

原创 LeetCode 141. Linked List Cycle(快慢指针)

Linked List CycleGiven a linked list, determine if it has a cycle in it.To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked l...

2019-07-12 15:41:50 140

原创 LeetCode 138. Copy List with Random Pointer(哈希)

题目来源:https://leetcode.com/problems/copy-list-with-random-pointer/问题描述138.Copy List with Random PointerMediumA linked list is given such that each node contains an additional random pointer wh...

2019-07-11 23:40:02 272

原创 LeetCode 137. Single Number II

题目来源:https://leetcode.com/problems/single-number-ii/问题描述137.Single Number IIMediumGiven anon-emptyarray of integers, every element appearsthreetimes except for one, which appears exact...

2019-07-11 00:31:59 217

原创 LeetCode 136. Single Number

题目来源:https://leetcode.com/problems/single-number/问题描述136.Single NumberEasyGiven anon-emptyarray of integers, every element appearstwiceexcept for one. Find that single one.Note:You...

2019-07-09 08:29:53 105

原创 144. Binary Tree Preorder Traversal(递归的栈模拟)

CandyHardThere are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at ...

2019-07-08 20:35:34 114

原创 LeetCode 134. Gas Station

题目来源:https://leetcode.com/problems/gas-station/问题描述134.Gas StationMediumThere areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an...

2019-07-07 22:09:15 280

原创 LeetCode 111. Minimum Depth of Binary Tree(二叉树)

Minimum Depth of Binary TreeEasy756412FavoriteShareGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the ...

2019-07-07 00:06:56 115

原创 redis有序集合zset的底层实现——跳跃表skiplist

redis有序集合zset的底层实现——跳跃表skiplistredis作为一种内存KV数据库,提供了string, hash, list, set, zset等多种数据结构。其中有序集合zset在增删改查的性质上类似于C++ stl的map和Java的TreeMap,提供了一组“键-值”对,并且“键”按照“值”的顺序排序。但是与C++ stl或Java的红黑树实现不同的是,redis中有序集合...

2019-07-05 17:42:17 8532

原创 LeetCode 132. Palindrome Partitioning II(动态规划)

题目来源:https://leetcode.com/problems/palindrome-partitioning-ii/问题描述132.Palindrome Partitioning IIHardGiven a strings, partitionssuch that every substring of the partition is a palindrome....

2019-07-05 10:27:07 246

原创 LeetCode 110. Balanced Binary Tree(二叉树)

题目来源:https://leetcode.com/problems/balanced-binary-tree/问题描述110.Balanced Binary TreeEasyGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tr...

2019-07-04 14:07:22 126

原创 Java与Python的import关键字的差别

Java与Python的import关键字的差别Java和Python的import都有引入包中的类的功能,但是Java作为一种编译型语言,Python作为一种解释型语言,其import关键字的执行机制有很大区别。Java中的importJava中的import的作用类似于C++的using,只是为本包以外的包中的类起一个简单的别名,使得我们可以通过“类名”而非“包名.类名“的方式直接使用外...

2019-07-02 10:54:58 827

空空如也

空空如也

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

TA关注的人

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