09 2015 档案

摘要:原题链接在这里:https://leetcode.com/problems/permutation-sequence/ 题目: The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labelin 阅读全文
posted @ 2015-09-30 03:43 Dylan_Java_NYC 阅读(296) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/combination-sum-iii/ 题目: Find all possible combinations of k numbers that add up to a number n, given that only 阅读全文
posted @ 2015-09-29 00:29 Dylan_Java_NYC 阅读(335) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/combination-sum-ii/ 题目: Given a collection of candidate numbers (C) and a target number (T), find all unique com 阅读全文
posted @ 2015-09-28 23:37 Dylan_Java_NYC 阅读(413) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/combination-sum/ 题目: Given an array of distinct integers candidates and a target integer target, return a list o 阅读全文
posted @ 2015-09-28 23:12 Dylan_Java_NYC 阅读(470) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/permutations-ii/ 题目: Given a collection of numbers that might contain duplicates, return all possible unique per 阅读全文
posted @ 2015-09-27 12:41 Dylan_Java_NYC 阅读(327) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/permutations/ 题目: Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3]  阅读全文
posted @ 2015-09-27 11:51 Dylan_Java_NYC 阅读(763) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/combinations/ 题目: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For 阅读全文
posted @ 2015-09-27 10:40 Dylan_Java_NYC 阅读(620) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/subsets-ii/ 题目: Given a collection of integers that might contain duplicates, nums, return all possible subsets. 阅读全文
posted @ 2015-09-27 10:02 Dylan_Java_NYC 阅读(348) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/subsets/ 题目: Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solu 阅读全文
posted @ 2015-09-27 09:48 Dylan_Java_NYC 阅读(1248) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/rotate-image/ 题目: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockw 阅读全文
posted @ 2015-09-27 09:09 Dylan_Java_NYC 阅读(276) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/spiral-matrix-ii/ 题目: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral o 阅读全文
posted @ 2015-09-26 04:12 Dylan_Java_NYC 阅读(386) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/spiral-matrix/ 题目: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in sp 阅读全文
posted @ 2015-09-26 03:00 Dylan_Java_NYC 阅读(352) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/first-bad-version/ 题目: You are a product manager and currently leading a team to develop a new product. Unfortun 阅读全文
posted @ 2015-09-26 02:06 Dylan_Java_NYC 阅读(278) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/container-with-most-water/ 题目: Given n non-negative integers a1, a2, ..., an , where each represents a point at 阅读全文
posted @ 2015-09-26 01:47 Dylan_Java_NYC 阅读(267) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/move-zeroes/ 题目: Given an array nums, write a function to move all 0's to the end of it while maintaining the re 阅读全文
posted @ 2015-09-24 10:52 Dylan_Java_NYC 阅读(270) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里: https://leetcode.com/problems/jump-game-ii/ 题目: Given an array of non-negative integers, you are initially positioned at the first index of t 阅读全文
posted @ 2015-09-24 03:52 Dylan_Java_NYC 阅读(569) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/jump-game/ 题目: Given an array of non-negative integers, you are initially positioned at the first index of the a 阅读全文
posted @ 2015-09-24 02:52 Dylan_Java_NYC 阅读(268) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/gas-station/ 题目: There are N gas stations along a circular route, where the amount of gas at station i is gas[i] 阅读全文
posted @ 2015-09-24 02:33 Dylan_Java_NYC 阅读(265) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/reverse-bits/ 题目: Reverse bits of a given 32 bits unsigned integer. Example 1: Example 2: Note: Note that in som 阅读全文
posted @ 2015-09-23 23:32 Dylan_Java_NYC 阅读(330) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/number-of-1-bits/ 题目: Write a function that takes an unsigned integer and return the number of '1' bits it has ( 阅读全文
posted @ 2015-09-22 04:56 Dylan_Java_NYC 阅读(386) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/dungeon-game/ 题目: The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a du 阅读全文
posted @ 2015-09-22 02:15 Dylan_Java_NYC 阅读(334) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/edit-distance/ 题目: Given two words word1 and word2, find the minimum number of steps required to convert word1 t 阅读全文
posted @ 2015-09-21 09:31 Dylan_Java_NYC 阅读(412) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/scramble-string/这道题参考了这篇帖子:http://blog.csdn.net/linhuanmars/article/details/24506703这其实是一道三维动态规划的题目,我们提出维护量res[i... 阅读全文
posted @ 2015-09-21 08:44 Dylan_Java_NYC 阅读(191) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/generate-parentheses/ 题目: Given n pairs of parentheses, write a function to generate all combinations of well-fo 阅读全文
posted @ 2015-09-21 07:15 Dylan_Java_NYC 阅读(243) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/reverse-words-in-a-string/ 题目: Given an input string, reverse the string word by word. For example,Given s = "th 阅读全文
posted @ 2015-09-21 04:42 Dylan_Java_NYC 阅读(266) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/simplify-path/ 题目: Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", =>  阅读全文
posted @ 2015-09-21 04:11 Dylan_Java_NYC 阅读(240) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/implement-strstr/ 题目: Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1  阅读全文
posted @ 2015-09-20 05:19 Dylan_Java_NYC 阅读(367) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/zigzag-conversion/ 题目: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like 阅读全文
posted @ 2015-09-20 00:31 Dylan_Java_NYC 阅读(293) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/length-of-last-word/ 题目: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', 阅读全文
posted @ 2015-09-19 23:51 Dylan_Java_NYC 阅读(240) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/count-and-say/ 题目: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 阅读全文
posted @ 2015-09-18 11:32 Dylan_Java_NYC 阅读(363) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/longest-common-prefix/ 题目: Write a function to find the longest common prefix string amongst an array of strings 阅读全文
posted @ 2015-09-18 10:28 Dylan_Java_NYC 阅读(190) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/compare-version-numbers/ 题目: Compare two version numbers version1 and version2.If version1 > version2 return 1, 阅读全文
posted @ 2015-09-18 10:01 Dylan_Java_NYC 阅读(162) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/interleaving-string/ 题目: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. Example 1 阅读全文
posted @ 2015-09-18 05:46 Dylan_Java_NYC 阅读(222) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/distinct-subsequences/ 题目: Given a string S and a string T, count the number of distinct subsequences of S which 阅读全文
posted @ 2015-09-18 04:31 Dylan_Java_NYC 阅读(203) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/longest-valid-parentheses/ 题目: Given a string containing just the characters '(' and ')', find the length of the 阅读全文
posted @ 2015-09-17 23:24 Dylan_Java_NYC 阅读(363) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/maximal-rectangle/ 题目: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing o 阅读全文
posted @ 2015-09-17 22:55 Dylan_Java_NYC 阅读(477) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/largest-rectangle-in-histogram/description/ 题目: Given n non-negative integers representing the histogram's bar h 阅读全文
posted @ 2015-09-17 04:35 Dylan_Java_NYC 阅读(270) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/ 题目: Say you have an array for which the ith element is the price of a given 阅读全文
posted @ 2015-09-16 12:42 Dylan_Java_NYC 阅读(303) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/ 题目: Say you have an array for which the ith element is the price of a given 阅读全文
posted @ 2015-09-16 12:29 Dylan_Java_NYC 阅读(275) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ 题目: Say you have an array for which the ith element is the price of a given 阅读全文
posted @ 2015-09-16 02:27 Dylan_Java_NYC 阅读(200) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ 题目: Say you have an array for which the ith element is the price of a given sto 阅读全文
posted @ 2015-09-15 23:05 Dylan_Java_NYC 阅读(358) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/maximal-square/ 题目: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1' 阅读全文
posted @ 2015-09-15 22:41 Dylan_Java_NYC 阅读(285) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/maximum-product-subarray/ 题目: Find the contiguous subarray within an array (containing at least one number) whic 阅读全文
posted @ 2015-09-15 12:14 Dylan_Java_NYC 阅读(629) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/maximum-subarray/ 题目: Find the contiguous subarray within an array (containing at least one number) which has th 阅读全文
posted @ 2015-09-15 11:48 Dylan_Java_NYC 阅读(406) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/decode-ways/ 题目: A message containing letters from A-Z is being encoded to numbers using the following mapping: 阅读全文
posted @ 2015-09-15 07:37 Dylan_Java_NYC 阅读(381) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/minimum-path-sum/ 题目: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom r 阅读全文
posted @ 2015-09-15 06:55 Dylan_Java_NYC 阅读(225) 评论(0) 推荐(0) 编辑
摘要:原题俩接在这里:https://leetcode.com/problems/ugly-number-ii/ 题目: Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime 阅读全文
posted @ 2015-09-15 06:21 Dylan_Java_NYC 阅读(276) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/ugly-number/ 题目: Write a program to check whether a given number is an ugly number. Ugly numbers are positive nu 阅读全文
posted @ 2015-09-15 06:07 Dylan_Java_NYC 阅读(195) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/powx-n/ 题目: Implement pow(x, n), which calculates x raised to the power n (xn). Example 1: Input: 2.00000, 10 Ou 阅读全文
posted @ 2015-09-15 03:00 Dylan_Java_NYC 阅读(271) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/perfect-squares/ 题目: Given a positive integer n, find the least number of perfect square numbers (for example, 1 阅读全文
posted @ 2015-09-15 00:51 Dylan_Java_NYC 阅读(273) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/sqrtx/ 题目: Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non 阅读全文
posted @ 2015-09-15 00:21 Dylan_Java_NYC 阅读(312) 评论(0) 推荐(0) 编辑
摘要:Check if a given number is a perfect square with only addition orsubstraction operation.eg. 25 returns true; 19 returns false.Perfect square number 有一... 阅读全文
posted @ 2015-09-14 02:43 Dylan_Java_NYC 阅读(242) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/unique-paths-ii/ 题目: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram be 阅读全文
posted @ 2015-09-14 01:39 Dylan_Java_NYC 阅读(282) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/unique-paths/ 题目: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below 阅读全文
posted @ 2015-09-13 07:47 Dylan_Java_NYC 阅读(357) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/palindrome-partitioning-ii/ 题目: Given a string s, partition s such that every substring of the partition is a pa 阅读全文
posted @ 2015-09-13 05:19 Dylan_Java_NYC 阅读(253) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/palindrome-partitioning/ 题目: Given a string s, partition s such that every substring of the partition is a palin 阅读全文
posted @ 2015-09-13 02:22 Dylan_Java_NYC 阅读(287) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/word-break-ii/ 题目: Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, ad 阅读全文
posted @ 2015-09-13 01:40 Dylan_Java_NYC 阅读(302) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/word-break/ 题目: Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a 阅读全文
posted @ 2015-09-12 06:49 Dylan_Java_NYC 阅读(335) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/triangle/ 题目: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent 阅读全文
posted @ 2015-09-12 03:08 Dylan_Java_NYC 阅读(234) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/house-robber-ii/ 题目: Note: This is an extension of House Robber. After robbing those houses on that street, the 阅读全文
posted @ 2015-09-11 11:30 Dylan_Java_NYC 阅读(300) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/house-robber/ 题目: You are a professional robber planning to rob houses along a street. Each house has a certain 阅读全文
posted @ 2015-09-11 10:18 Dylan_Java_NYC 阅读(370) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/climbing-stairs/ 题目: You are climbing a stair case. It takes n steps to reach to the top. Each time you can eith 阅读全文
posted @ 2015-09-11 09:51 Dylan_Java_NYC 阅读(275) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/binary-tree-maximum-path-sum/ 题目: Given a non-empty binary tree, find the maximum path sum. For this problem, a 阅读全文
posted @ 2015-09-11 07:09 Dylan_Java_NYC 阅读(263) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/unique-binary-search-trees-ii/ 题目: Given an integer n, generate all structurally unique BST's (binary search tre 阅读全文
posted @ 2015-09-11 03:11 Dylan_Java_NYC 阅读(1015) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/unique-binary-search-trees/ 题目: Given n, how many structurally unique BST's (binary search trees) that store val 阅读全文
posted @ 2015-09-11 02:21 Dylan_Java_NYC 阅读(292) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/validate-binary-search-tree/ 题目: Given a binary tree, determine if it is a valid binary search tree (BST). Assum 阅读全文
posted @ 2015-09-10 23:05 Dylan_Java_NYC 阅读(229) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/recover-binary-search-tree/description/ 题目: T Two elements of a binary search tree (BST) are swapped by mistake. 阅读全文
posted @ 2015-09-10 07:04 Dylan_Java_NYC 阅读(217) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/ 题目: Given a binary tree Populate each next pointer to point to i 阅读全文
posted @ 2015-09-10 04:52 Dylan_Java_NYC 阅读(315) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/populating-next-right-pointers-in-each-node/ 题目: You are given a perfect binary tree where all leaves are on the 阅读全文
posted @ 2015-09-10 02:48 Dylan_Java_NYC 阅读(538) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/binary-tree-right-side-view/ 题目: Given a binary tree, imagine yourself standing on the right side of it, return 阅读全文
posted @ 2015-09-10 02:16 Dylan_Java_NYC 阅读(268) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/kth-smallest-element-in-a-bst/description/ 题目: Given a binary search tree, write a function kthSmallest to find 阅读全文
posted @ 2015-09-09 09:08 Dylan_Java_NYC 阅读(310) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/flatten-binary-tree-to-linked-list/description/ 题目: Given a binary tree, flatten it to a linked list in-place. F 阅读全文
posted @ 2015-09-09 08:03 Dylan_Java_NYC 阅读(429) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/count-complete-tree-nodes/ 题目: Given a complete binary tree, count the number of nodes. Definition of a complete 阅读全文
posted @ 2015-09-09 00:48 Dylan_Java_NYC 阅读(230) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/sum-root-to-leaf-numbers/ 题目: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could 阅读全文
posted @ 2015-09-07 22:29 Dylan_Java_NYC 阅读(257) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/path-sum-ii/ 题目: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the giv 阅读全文
posted @ 2015-09-07 04:14 Dylan_Java_NYC 阅读(561) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/binary-tree-paths/ 题目: Given a binary tree, return all root-to-leaf paths. For example, given the following bina 阅读全文
posted @ 2015-09-06 12:53 Dylan_Java_NYC 阅读(312) 评论(0) 推荐(0) 编辑
摘要:To convert a int to string:int num = 123;String str = String.valueOf(num);To convert a string to int:String str = "123";int num = Integer.valueOf(str)... 阅读全文
posted @ 2015-09-06 12:41 Dylan_Java_NYC 阅读(272) 评论(0) 推荐(0) 编辑
摘要:Java 的 annotation 以@开头 比如@Override. 不改变complied program的action annotation不完全是comments 能够改变一段代码compile的方式 下面这段代码因为base class里没有display(int x), 所以是用@Ove 阅读全文
posted @ 2015-09-06 12:02 Dylan_Java_NYC 阅读(159) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ 题目: Given a binary tree, find the lowest common ancestor (LCA) of two g 阅读全文
posted @ 2015-09-05 05:11 Dylan_Java_NYC 阅读(409) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/ 题目: Given a binary search tree (BST), find the lowest common anc 阅读全文
posted @ 2015-09-05 04:52 Dylan_Java_NYC 阅读(299) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/invert-binary-tree/ 题目: Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 题解: 既可以自顶向下 阅读全文
posted @ 2015-09-05 02:27 Dylan_Java_NYC 阅读(165) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/symmetric-tree/ 题目: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center 阅读全文
posted @ 2015-09-05 02:06 Dylan_Java_NYC 阅读(181) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/binary-tree-level-order-traversal-ii/ 题目: Given a binary tree, return the bottom-up level order traversal of its 阅读全文
posted @ 2015-09-05 01:47 Dylan_Java_NYC 阅读(170) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/same-tree/ 题目: Given two binary trees, write a function to check if they are equal or not. Two binary trees are 阅读全文
posted @ 2015-09-05 01:24 Dylan_Java_NYC 阅读(279) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/minimum-depth-of-binary-tree/ 题目: Given a binary tree, find its minimum depth. The minimum depth is the number o 阅读全文
posted @ 2015-09-05 01:07 Dylan_Java_NYC 阅读(255) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/maximum-depth-of-binary-tree/ 题目: Given a binary tree, find its maximum depth. The maximum depth is the number o 阅读全文
posted @ 2015-09-05 00:49 Dylan_Java_NYC 阅读(242) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/balanced-binary-tree/ 题目: Given a binary tree, determine if it is height-balanced. For this problem, a height-ba 阅读全文
posted @ 2015-09-05 00:44 Dylan_Java_NYC 阅读(196) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/reorder-list/ 题目: Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must 阅读全文
posted @ 2015-09-03 05:49 Dylan_Java_NYC 阅读(190) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ 题目: Given an array where elements are sorted in ascending order, con 阅读全文
posted @ 2015-09-03 04:04 Dylan_Java_NYC 阅读(258) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/ 题目: Given a singly linked list where elements are sorted in ascending 阅读全文
posted @ 2015-09-03 03:36 Dylan_Java_NYC 阅读(370) 评论(0) 推荐(0) 编辑
摘要:Private means this could only be seen within this class. Protected means "package private", this could be seen by subclasses and package members. | Cl 阅读全文
posted @ 2015-09-03 03:07 Dylan_Java_NYC 阅读(147) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/sort-list/ 题目: Sort a linked list in O(n log n) time using constant space complexity. 题解: divide and conquer. 从中 阅读全文
posted @ 2015-09-03 02:59 Dylan_Java_NYC 阅读(167) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/insertion-sort-list/ 题目: Sort a linked list using insertion sort. 题解: 与Sort List类似. 当出现cur.val > cur.next.val时就需 阅读全文
posted @ 2015-09-03 01:16 Dylan_Java_NYC 阅读(215) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/ 题目: Follow up for "Remove Duplicates":What if duplicates are allowed at 阅读全文
posted @ 2015-09-02 13:01 Dylan_Java_NYC 阅读(309) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/remove-duplicates-from-sorted-array/ 题目: Given a sorted array, remove the duplicates in place such that each ele 阅读全文
posted @ 2015-09-02 12:38 Dylan_Java_NYC 阅读(189) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/ 题目: Given a sorted linked list, delete all nodes that have duplicate numb 阅读全文
posted @ 2015-09-02 12:25 Dylan_Java_NYC 阅读(257) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/remove-duplicates-from-sorted-list/ 题目: Given a sorted linked list, delete all duplicates such that each element 阅读全文
posted @ 2015-09-02 12:19 Dylan_Java_NYC 阅读(274) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/partition-list/ 题目: Given a linked list and a value x, partition it such that all nodes less than x come before 阅读全文
posted @ 2015-09-01 04:28 Dylan_Java_NYC 阅读(251) 评论(0) 推荐(0) 编辑
摘要:原题链接在这里:https://leetcode.com/problems/linked-list-cycle-ii/ 题目: Given a linked list, return the node where the cycle begins. If there is no cycle, ret 阅读全文
posted @ 2015-09-01 03:45 Dylan_Java_NYC 阅读(296) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示