摘要:
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r 阅读全文
摘要:
Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. 方法一:迭代 方法二:递归 阅读全文
摘要:
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: //如果有子节点,字符串随着递归一直累加,直到没 阅读全文
摘要:
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
摘要:
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 symmet 阅读全文
摘要:
39、combination sum1 Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the can 阅读全文
摘要:
回溯法的典型 1、Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the giv 阅读全文
摘要:
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文