
LeetCode
boy_nihao
coding
展开
-
leetcode:119. Pascal's Triangle II(Java)解答
转载请注明出处:z_zhaojun的博客 原文地址:http://blog.youkuaiyun.com/u012975705/题目地址:https://leetcode.com/problems/pascals-triangle-ii/Pascal’s Triangle IIGiven an index k, return the kth row of the Pascal's tri原创 2016-01-10 17:52:58 · 2496 阅读 · 0 评论 -
leetcode:41. First Missing Positive (Java)
转载请注明出处:z_zhaojun的博客 原文地址 题目地址 First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algo原创 2016-03-13 15:28:32 · 1747 阅读 · 1 评论 -
leetcode:268. Missing Number(Java)解答
转载请注明出处:z_zhaojun的博客 原文地址 题目地址 Missing NumberGiven an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3原创 2016-03-11 22:07:30 · 2871 阅读 · 0 评论 -
leetcode:144. Binary Tree Preorder Traversal
转载请注明出处:z_zhaojun的博客 原文地址 题目地址 Binary Tree Preorder TraversalGiven a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3},return [1,2,3].思路:优先添原创 2016-03-19 22:09:45 · 1712 阅读 · 0 评论 -
leetcode:122. Best Time to Buy and Sell Stock II(java)解答
转载请注明出处:z_zhaojun的博客 原文地址 题目地址 Best Time to Buy and Sell Stock IISay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum pro原创 2016-03-05 17:43:02 · 1949 阅读 · 0 评论 -
leetcode:121. Best Time to Buy and Sell Stock(Java)解答
转载请注明出处:z_zhaojun的博客 原文地址 题目地址 Best Time to Buy and Sell Stock My Submissions QuestionSay you have an array for which the ith element is the price of a given stock on day i.If you were only permit原创 2016-03-05 17:14:05 · 2435 阅读 · 0 评论 -
leetcode:238. Product of Array Except Self(Java)解答
转载请注明出处:z_zhaojun的博客 原文地址 题目地址 Product of Array Except SelfGiven an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of原创 2016-03-05 14:14:02 · 1838 阅读 · 0 评论 -
leetcode:142. Linked List Cycle II(Java)解答
转载请注明出处:z_zhaojun的博客 原文地址:http://blog.youkuaiyun.com/u012975705 题目地址:https://leetcode.com/problems/linked-list-cycle-ii/Linked List Cycle IIGiven a linked list, return the node where the cycle be原创 2015-12-27 16:36:19 · 2877 阅读 · 1 评论 -
leetcode:82. Remove Duplicates from Sorted List II(Java)解答
转载请注明出处:z_zhaojun的博客 原文地址:http://blog.youkuaiyun.com/u012975705 题目地址:https://leetcode.com/problems/reverse-linked-list-ii/Remove Duplicates from Sorted List IIGiven a sorted linked list, delete all原创 2015-12-27 00:18:19 · 2066 阅读 · 1 评论 -
leetcode:92. Reverse Linked List II(Java)解答
转载请注明出处:z_zhaojun的博客 原文地址:http://blog.youkuaiyun.com/u012975705 题目地址:https://leetcode.com/problems/reverse-linked-list-ii/Reverse Linked List IIReverse a linked list from position m to n. Do it in-place an原创 2015-12-26 16:14:34 · 2750 阅读 · 0 评论 -
leetcode:283. Move Zeroes(Java)解答
转载请注明出处:z_zhaojun的博客 原文地址:http://blog.youkuaiyun.com/u012975705题目地址:https://leetcode.com/problems/move-zeroes/ Move ZeroesGiven an array nums, write a function to move all 0's to the end of it while原创 2016-01-10 21:05:39 · 2346 阅读 · 1 评论 -
回顾:树的几种迭代遍历方式
PS:文章最后附上完整代码一、中序遍历List<Integer> inOrder(BTree root) { List<Integer> result = new ArrayList<>(); Stack<BTree> stack = new Stack<&a原创 2018-05-09 19:56:50 · 2353 阅读 · 0 评论