随笔分类 -  LeetCode

1 2 下一页

LeetCode刷题记录和总结
leetcode--95. Unique Binary Search Trees II
摘要:1、原题描述 95. Unique Binary Search Trees II Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For 阅读全文

posted @ 2017-11-23 23:00 Shihu 阅读(203) 评论(0) 推荐(0)

leetcode--96. Unique Binary Search Trees
摘要:1、问题描述 Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3, there are a total of 5 uniq 阅读全文

posted @ 2017-11-23 21:33 Shihu 阅读(261) 评论(0) 推荐(0)

leetcode分类总结
摘要:https://lefttree.gitbooks.io/leetcode-categories/index.html 阅读全文

posted @ 2017-11-23 14:39 Shihu 阅读(227) 评论(0) 推荐(0)

leetcode-115. Distinct Subsequences
摘要:1、原题链接 Given a string S and a string T, count the number of distinct subsequences of S which equals T. A subsequence of a string is a new string which 阅读全文

posted @ 2017-11-20 23:35 Shihu 阅读(194) 评论(0) 推荐(0)

leetcode--138. Copy List with Random Pointer
摘要:1,问题描述 A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a de 阅读全文

posted @ 2017-10-17 22:52 Shihu 阅读(221) 评论(0) 推荐(0)

leetcode-70. Climbing Stairs
摘要:原题描述: 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 阅读全文

posted @ 2017-10-14 23:09 Shihu 阅读(190) 评论(0) 推荐(0)

leetcode--124. Binary Tree Maximum Path Sum
摘要:1、问题描述 Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any nod 阅读全文

posted @ 2017-09-02 00:04 Shihu 阅读(166) 评论(0) 推荐(0)

leetcode--103. Binary Tree Zigzag Level Order Traversal
摘要:1、问题描述 Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next lev 阅读全文

posted @ 2017-09-01 01:09 Shihu 阅读(154) 评论(0) 推荐(0)

leetcode--Learn one iterative inorder traversal, apply it to multiple tree questions (Java Solution)
摘要:will show you all how to tackle various tree questions using iterative inorder traversal. First one is the standard iterative inorder traversal using 阅读全文

posted @ 2017-09-01 00:09 Shihu 阅读(172) 评论(0) 推荐(0)

leetcode--98. Validate Binary Search Tree
摘要:1、问题描述 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contai 阅读全文

posted @ 2017-08-31 23:19 Shihu 阅读(456) 评论(0) 推荐(0)

leetcode--47. Permutations II
摘要:1、问题描述 Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following un 阅读全文

posted @ 2017-08-31 22:20 Shihu 阅读(222) 评论(0) 推荐(0)

leetcode--101. Symmetric Tree
摘要:1、问题描述 Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is 阅读全文

posted @ 2017-08-31 09:53 Shihu 阅读(154) 评论(0) 推荐(0)

leetcode--110. Balanced Binary Tree
摘要:1、问题描述 Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which t 阅读全文

posted @ 2017-08-31 09:53 Shihu 阅读(178) 评论(0) 推荐(0)

leetcode-- 100. Same Tree
摘要:1、问题描述 Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally iden 阅读全文

posted @ 2017-08-31 09:53 Shihu 阅读(137) 评论(0) 推荐(0)

leetcoe--47. Permutations II
摘要:1、问题描述 Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following un 阅读全文

posted @ 2017-08-31 09:52 Shihu 阅读(231) 评论(0) 推荐(0)

leetcode--257. Binary Tree Paths
摘要:1、问题描述 Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: 2、边界条件:root为null; 阅读全文

posted @ 2017-08-31 09:52 Shihu 阅读(178) 评论(0) 推荐(0)

leetcode-- 90. Subsets II
摘要:1、问题描述 Given a collection of integers that might contain duplicates, nums, return all possible subsets. Note: The solution set must not contain duplic 阅读全文

posted @ 2017-08-29 01:12 Shihu 阅读(295) 评论(0) 推荐(0)

leetcode--401. Binary Watch
摘要:1、问题描述 A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED repr 阅读全文

posted @ 2017-08-28 00:19 Shihu 阅读(217) 评论(0) 推荐(0)

leetcode-- 79. Word Search
摘要:1、问题描述 Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where 阅读全文

posted @ 2017-08-27 19:21 Shihu 阅读(230) 评论(0) 推荐(0)

leetcode--51. N-Queens
摘要:1、问题描述: The 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, ret 阅读全文

posted @ 2017-08-27 14:21 Shihu 阅读(188) 评论(0) 推荐(0)

1 2 下一页

导航