摘要:
Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed from t 阅读全文
摘要:
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Note:Could you optimize your algorithm to us 阅读全文
摘要:
Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution sti 阅读全文
摘要:
Given a binary tree Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL 阅读全文
摘要:
Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: 这道题就是将数变为只有右节点的树。 递归,不是很难。 递归的时候求出左节 阅读全文