二叉树-中序遍历
2023-12-06 11:14:30 0 举报
二叉树-中序遍历
作者其他创作
大纲/内容
2. current = current.left
1
pointer(25)
pointer(36)
36
left
right
1. current = stack.pop()!
res
current
null
73
2. res.push(current.value)
51
25
16
stack
3
pointer(73)
pointer(51)
3. current = current.right
1. stack.push(current)
2. res.push(current.value)
1. current = stack.pop()!
3. current = current.right
pointer(16)
1. stack.push(current)
需要断开的链接
pointer(1)
2. current = current.left
2. current = current.left
新建立的链接
1. stack.push(current)
指针
2. current = current.left
3. current = current.right
2. res.push(current.value)
1. current = stack.pop()!
2
2. current = current.left;
1. current = stack.pop()!
3. current = current.right
1. stack.push(current);
0 条评论
下一页