摘要: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
阅读全文
摘要: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
阅读全文
摘要:https://lefttree.gitbooks.io/leetcode-categories/index.html
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:原题描述: 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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:will show you all how to tackle various tree questions using iterative inorder traversal. First one is the standard iterative inorder traversal using
阅读全文
摘要: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
阅读全文
摘要:1、问题描述 Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following un
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:1、问题描述 Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following un
阅读全文
摘要: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;
阅读全文
摘要:1、问题描述 Given a collection of integers that might contain duplicates, nums, return all possible subsets. Note: The solution set must not contain duplic
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文