非递归前序遍历二叉树算法实现与链栈结构设计.pdfVIP

  • 0
  • 0
  • 约1.1万字
  • 约 8页
  • 2026-06-08 发布于北京
  • 举报

非递归前序遍历二叉树算法实现与链栈结构设计.pdf

voidpre_order(){if(root==NULL)return;linkstack_t*s

=create_empty_linkstack();bitree_t*temp=root;

while(temp!=NULL||!is_empty_linkstack(s)){

while(temp!=NULL){printf(%c,temp‑data);

push_linkstack(s,temp);temp=temp‑lchild;}if(!

is_empty_linkstack(s)){temp=pop_linkstack(s

文档评论(0)

1亿VIP精品文档

相关文档