博客主机

二叉树的非递归遍历

二叉树遍历有以下几种情况: 先序遍历:先遍历根节点,再左子数,再右子树 中序遍历:先遍历左子树,再根节点,再右子树 后续遍历:先遍历左子树,再右子树,再根节点 要使用非递归的方法,使用栈来模拟递归遍历 非递归的先序遍历二叉树 访问根节点后,循环遍历左子树,此时根,左节点都已经被处理了,只要右子树压入栈即可;当左子树遍历完后,从栈中取出右子树;并对该子树重复上述过程。 void preOrd...

The STAR Principle

The STAR principle is an excellent guide for structuring a rounded example/piece of evidence. It’s an acronym and corresponds to: Situation – what was the situation, the setting? Task – what was to be achieved, what was the goal? Action – what did you do? Result – what was the outcome, the result? Here is an example, A poor statement example: ‘I am an excellent leader and bu...
Copyright © 小小的数据技术梦想 保留所有权利.   Theme  Ality 浙ICP备12043346号-1

用户登录

分享到: