New posts
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
Level order with a queue, step by step
|
||||
======================================
|
||||
|
||||
step | action | queue (front..back) | output so far
|
||||
1 | poll 1, visit, offer its children | [2 3] | [1]
|
||||
2 | poll 2, visit, offer its children | [3 4 5] | [1 2]
|
||||
3 | poll 3, visit, offer its children | [4 5 6] | [1 2 3]
|
||||
4 | poll 4, visit, offer its children | [5 6] | [1 2 3 4]
|
||||
5 | poll 5, visit, offer its children | [6 7] | [1 2 3 4 5]
|
||||
6 | poll 6, visit, offer its children | [7 8 9] | [1 2 3 4 5 6]
|
||||
7 | poll 7, visit, offer its children | [8 9] | [1 2 3 4 5 6 7]
|
||||
8 | poll 8, visit, offer its children | [9] | [1 2 3 4 5 6 7 8]
|
||||
9 | poll 9, visit, offer its children | [] | [1 2 3 4 5 6 7 8 9]
|
||||
Reference in New Issue
Block a user