Leetcode
xiaohan_whaleshark
小涵很懒,什么都没有写
展开
-
【Leetcode 141】Linked List Cycle - EASY
Leetcode 141 Linked List Cycle - EASY题目思路题解反思复杂度分析思路反思扩展学习题目Given 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 repr...原创 2019-03-13 21:40:53 · 90 阅读 · 0 评论 -
【Leetcode 209】Minimum Size Subarray Sum - MEDIUM
【Leetcode 209】Minimum Size Subarray Sum - MEDIUM题目思路题解反思复杂度分析题目Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. ...原创 2019-07-21 23:07:10 · 198 阅读 · 0 评论 -
【Leetcode 718】Maximum Length of Repeated Subarray - MEDIUM
【Leetcode 718】Maximum Length of Repeated Subarray - MEDIUM题目思路题解反思复杂度分析题目Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays.给定两个整数数组A,B,返回这两个数组中连...原创 2019-07-21 22:31:48 · 270 阅读 · 0 评论 -
【Leetcode 516】Longest Palindromic Subsequence - MEDIUM
【Leetcode 516】Longest Palindromic Subsequence - MEDIUM题目思路题解反思复杂度分析思路反思扩展题目Given a string s, find the longest palindromic subsequence’s length in s. You may assume that the maximum length of s is 10...原创 2019-07-21 10:27:08 · 195 阅读 · 0 评论 -
【Leetcode 5】 Longest Palindromic Substring - MEDIUM
【Leetcode 5】 Longest Palindromic Substring - MEDIUM题目思路题解题解反思复杂度分析思路反思扩展题目Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.给定字符串s,找...原创 2019-07-21 09:47:58 · 209 阅读 · 0 评论 -
【Leetcode 70】Climbing Stairs -EASY
【Leetcode 70】Climbing Stairs -EASY题目思路题解反思复杂度分析思路反思题目You 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 y...原创 2019-07-20 23:28:34 · 195 阅读 · 0 评论 -
【Leetcode 53】 Maximum Subarray - EASY
【Leetcode 53】Maximum Subarray - EASY题目思路题解反思复杂度分析思路反思题目Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.给定整数数组...原创 2019-07-20 23:05:37 · 203 阅读 · 0 评论 -
【Leetcode 144】Binary Tree Preorder Traversal - MEDIUM
【Leetcode 144】Binary Tree Preorder Traversal - MEDIUM题目思路题解题解1题解2反思复杂度分析思路反思扩展题目Given a binary tree, return the preorder traversal of its nodes’ values.给定一个二叉树,返回其前序遍历序列。示例思路前序遍历(DLR),是二叉树遍历的...原创 2019-03-19 13:27:00 · 119 阅读 · 0 评论 -
【Leetcode 94】Binary Tree Inorder Traversal - MEDIUM
【Leetcode 94】Binary Tree Inorder Traversal - MEDIUM题目![在这里插入图片描述](https://img-blog.csdnimg.cn/20190316211811241.png)思路题解题解1题解2反思复杂度分析思路反思扩展题目Given a binary tree, return the inorder traversal of its ...原创 2019-03-18 20:05:57 · 136 阅读 · 0 评论 -
【Leetcode 617】Merge Two Binary Trees -EASY
【Leetcode 617】Merge Two Binary Trees - EASY题目示例:![在这里插入图片描述](https://img-blog.csdnimg.cn/20190316201010341.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLm...原创 2019-03-16 21:14:37 · 129 阅读 · 0 评论 -
【Leetcode 232】 Implement Queue using Stacks - EASY
【Leetcode 232】 Implement Queue using Stacks - EASY题目思路思路1题解反思复杂度分析思路反思扩展学习方法1方法2题目Implement the following operations of a queue using stacks.push(x) – Push element x to the back of queue.pop() – R...原创 2019-03-15 12:51:53 · 124 阅读 · 0 评论 -
【Leetcode 225】 Implement Stack using Queues - EASY
【Leetcode 225】 Implement Stack using Queues - EASY题目思路题解反思复杂度分析思路反思扩展学习题目Implement the following operations of a stack using queues.push(x) – Push element x onto stack.pop() – Removes the element ...原创 2019-03-14 17:11:46 · 156 阅读 · 0 评论 -
【Leetcode 142】Linked List Cycle Ⅱ - MEDIUM
Leetcode 142 Linked List Cycle Ⅱ - MEDIUM使用哈希表和快慢指针两种方法来解决问题。Given a linked list, return the node where the cycle begins. If there is no cycle, return null..To represent a cycle in the given l...原创 2019-03-14 10:11:54 · 110 阅读 · 0 评论 -
【Leetcode 384】Shuffle an Array - MEDIUM
题目Shuffle a set of numbers without duplicates.打乱一组不重复的数字。示例思路思路1最容易想到的思路,是第一次从n个数中随机选一个,第二次从n-1个中选,第三次从n-2个中选,第n次中选唯一的一个,一共是 n! 种结果。于是选择用一个list来存储下标,每次随机选择一下标,将该下标对应的元素值赋给新数组,选择完成后,将选定下标从list...原创 2019-08-15 14:30:44 · 268 阅读 · 0 评论