会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
INnoVation-V2
首页
新随笔
管理
2021年9月3日
树遍历非递归
摘要: 非递归的遍历模板 1.先序遍历 根左右 Stack<TreeNode> stack = new Stack<>(); while(!stack.isEmpty() || root != null){ while(root != null){ visit(根节点) stack.push(root);
阅读全文
posted @ 2021-09-03 01:10 INnoVation-V2
阅读(51)
评论(0)
推荐(0)
公告