mirror of
https://github.com/krahets/hello-algo.git
synced 2026-05-12 11:37:08 +08:00
build
This commit is contained in:
@@ -460,7 +460,7 @@ To deepen the understanding, it is suggested to combine Figure 9-12 with the cod
|
||||
|
||||
Similar to breadth-first traversal, the order of the depth-first traversal sequence is also not unique. Given a certain vertex, exploring in any direction first is possible, that is, the order of adjacent vertices can be arbitrarily shuffled, all being part of depth-first traversal.
|
||||
|
||||
Taking tree traversal as an example, "root $\rightarrow$ left $\rightarrow$ right", "left $\rightarrow$ root $\rightarrow$ right", "left $\rightarrow$ right $\rightarrow$ root" correspond to preorder, inorder, and postorder traversals, respectively. They showcase three types of traversal priorities, yet all three are considered depth-first traversal.
|
||||
Taking tree traversal as an example, "root $\rightarrow$ left $\rightarrow$ right", "left $\rightarrow$ root $\rightarrow$ right", "left $\rightarrow$ right $\rightarrow$ root" correspond to pre-order, in-order, and post-order traversals, respectively. They showcase three types of traversal priorities, yet all three are considered depth-first traversal.
|
||||
|
||||
### 2. Complexity analysis
|
||||
|
||||
|
||||
Reference in New Issue
Block a user