随笔分类 - Tree
摘要:116. Populating Next Right Pointers in Each Node Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next
阅读全文
摘要: Subscribe to see which companies asked this question
阅读全文
摘要:For example, this binary tree is symmetric: But the following is not: Note:Bonus points if you could solve it both recursively and iteratively. co
阅读全文
摘要:Note:You may assume that duplicates do not exist in the tree. Subscribe to see which companies asked this question
阅读全文
摘要:Note:You may assume that duplicates do not exist in the tree. Subscribe to see which companies asked this question
阅读全文
摘要: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 the dept
阅读全文
摘要:102. Binary Tree Level Order Traversal Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by l
阅读全文
摘要:public List<Integer> inorderTraversal(TreeNode root) { Deque<TreeNode> nodes = new ArrayDeque<TreeNode>(); List<Integer> visits = new LinkedList<Integ
阅读全文
摘要:
阅读全文

浙公网安备 33010602011771号