摘要: 根据给出的先序遍历和中序遍历,画出二叉树。 先序遍历:DBACEGF 中序遍历:ABCDEFG 首先我们来看一下三种遍历方式: 1)先序遍历二叉树 (1)访问根节点 (2)先序遍历跟的左子树 (3)先序遍历根的右子树 2)中序遍历二叉树 (1)中序遍历根的左子树 (2)访问根节点 (3)中序遍历根的 阅读全文
posted @ 2018-11-07 14:38 自强· 阅读(6787) 评论(0) 推荐(0) 编辑
摘要: To record her trees for future generations, she wrote down two strings for each tree: a preorder traversal (root, left subtree, right subtree) and an 阅读全文
posted @ 2018-11-07 11:46 自强· 阅读(289) 评论(0) 推荐(0) 编辑