
树
attention!
新丰美酒斗十千,咸阳游侠多少年。相逢意气为君饮,系马高楼垂柳边。
展开
-
二叉树遍历(中序)(递归+非递归)
Binary Tree Inorder Traversal(二叉树中序遍历)Given a binary tree, return the inorder traversal of its nodes’ values.For example:Given binary tree{1,#,2,3},return[1,3,2].Note: Recursive solution is triv...原创 2018-12-14 23:06:00 · 436 阅读 · 0 评论 -
二叉树遍历(前序)(递归+非递归)
题目Binary Tree Preorder TraversalGiven a binary tree, return the preorder traversal of its nodes’ values.For example:Given binary tree{1,#,2,3},return[1,2,3].Note: Recursive solution is trivia...原创 2018-12-16 14:39:20 · 251 阅读 · 0 评论 -
Symmetric Tree(对称树)
题目描述Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric:But the following is not:Note:Bonus points if you co...原创 2019-01-05 12:57:18 · 366 阅读 · 0 评论 -
binary tree level order traversal ii)(二叉树自下向上层序遍历)
题目描述Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree{3,9,20,#,#,15,7},...原创 2019-01-13 15:49:10 · 194 阅读 · 0 评论