随笔分类 -  tree(non recursion)

156. Binary Tree Upside Down
摘要:Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it up 阅读全文

posted @ 2018-11-09 07:33 猪猪🐷

222. Count Complete Tree Nodes
摘要:https://leetcode.com/problems/count-complete-tree-nodes/discuss/61958/Concise-Java-solutions-O(log(n)2) 阅读全文

posted @ 2018-11-08 16:52 猪猪🐷

339. Nested List Weight Sum
摘要:Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or a list -- whose elements may also be integers or other lists... 阅读全文

posted @ 2018-11-07 05:27 猪猪🐷

117. Populating Next Right Pointers in Each Node II
摘要: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 阅读全文

posted @ 2018-08-09 17:02 猪猪🐷

导航