首页 > 其他 > 详细

Binary Tree Traversal

时间:2014-04-10 07:53:52      阅读:425      评论:0      收藏:0      [点我收藏+]

Binary Tree的三种Traversal方法老是记混,故于此总结下。

Preorder: Node -> Left subtree -> Right subtree

Inorder: Left subtree -> Node -> Right subtree

Postorder: Left subtree -> Right subtree -> Node

Pre, In, Post指的是Node本身在[Node, Left, Right]中被访问的顺序。Pre is 1st, In is 2nd, Post is 3rd.

Note: Inorder traversal of a BST would produce a strictly increasing list of integers.

Binary Tree Traversal,布布扣,bubuko.com

Binary Tree Traversal

原文:http://www.cnblogs.com/Antech/p/3655590.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!