Traversal content

traversal

<data> Processing {nodes} in a {graph} one at a time, usually
in some specified order. Traversal of a tree is {recursive}ly
defined to mean visiting the {root node} and traversing its
children. Visiting a node usually involves transforming it in
some way or collecting data from it.

In "pre-order traversal", a node is visited _before_ its
children. In "post-order" traversal, a node is visited
_after_ its children. The more rarely used "in-order"
traversal is generally applicable only to binary trees, and is
where you visit first a node's left child, then the node
itself, and then its right child.

For the binary tree:

T
/ \
I S
/ \
D E

A pre-order traversal visits the nodes in the order T I D E S.
A post-order traversal visits them in the order D E I S T. An
in-order traversal visits them in the order D I E T S.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值