摘要:
题目:Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same re... 阅读全文
摘要:
题目:Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will ... 阅读全文
摘要:
题目:Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled ... 阅读全文
摘要:
题目:Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For exam... 阅读全文
摘要:
题目:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: ... 阅读全文
摘要:
题目:Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 w... 阅读全文
摘要:
题目:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.题解:这道题跟pre... 阅读全文
摘要:
题目:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.题解: 1 ... 阅读全文
摘要:
题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.题解:之前做过一道是从sorted array转换到BinarySearc... 阅读全文
摘要:
题目: Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program should return... 阅读全文
摘要:
下面应用转自Wikipedia(http://zh.wikipedia.org/wiki/%E5%8D%A1%E5%A1%94%E5%85%B0%E6%95%B0):组合数学中有非常多的组合结构可以用卡塔兰数来计数。在Richard P. Stanley的Enumerative Combinato... 阅读全文
摘要:
题目: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 unique B... 阅读全文
摘要:
题目: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 "ad... 阅读全文