Skip to content

Commit 3991530

Browse files
committed
docs: change word
1 parent 11ad1cd commit 3991530

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

maximum-depth-of-binary-tree/invidam.go.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ func maxDepth(root *TreeNode) int {
2626
```
2727
- - -
2828
# Intuition
29-
Implement Stack can be troublesome, but it is effective to problem that require tracking depths or levels.
29+
Implement Queue can be troublesome, but it is effective to problem that require tracking depths or levels.
3030
<!-- Describe your first thoughts on how to solve this problem. -->
3131

3232
# Approach
3333
<!-- Describe your approach to solving the problem. -->
34-
1. Maintain Element belonging to the same level in the stack.
35-
2. While Iterating through the stack, remove the current level and save the next level.
34+
1. Maintain Element belonging to the same level in the queue.
35+
2. While Iterating through the queue, remove the current level and save the next level.
3636
- In GoLang, `range for loop` capture only first once. So We can maintain current level's easily.
3737
3. increase depth while iterationg through all elements until the end.
3838
# Complexity

0 commit comments

Comments
 (0)