加载中...

第五章 树的存储,树和森林的遍历

双亲表示法(顺序存储)

image

孩子表示法(顺序+链式存储)

image

孩子兄弟表示法(链式存储)

image

树和二叉树的转换

image

森林和二叉树的转换

image

知识回顾

image

树和森林的遍历

image

树的定义

image
笑死image
image

树的先根遍历

image

树的后根遍历

先根遍历和后根遍历称为深度优先遍历
image

树的层次遍历

称为广度优先遍历
image

森林的先序遍历

image
或者转为二叉树
image

森林的中序遍历

image
image
image

posted @ 2023-05-21 10:13  春江天一色  阅读(22)  评论(0)    收藏  举报