Skip to content

Commit 5d9d89c

Browse files
authored
Change front and top to first (#842)
1 parent 2c47302 commit 5d9d89c

File tree

1 file changed

+2
-2
lines changed
  • contents/tree_traversal/code/julia

1 file changed

+2
-2
lines changed

contents/tree_traversal/code/julia/Tree.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function DFS_stack(n::Node)
4747
push!(s, n)
4848

4949
while(length(s) > 0)
50-
println(top(s).ID)
50+
println(first(s).ID)
5151
temp = pop!(s)
5252
for child in temp.children
5353
push!(s, child)
@@ -60,7 +60,7 @@ function BFS_queue(n::Node)
6060
enqueue!(q, n)
6161

6262
while(length(q) > 0)
63-
println(front(q).ID)
63+
println(first(q).ID)
6464
temp = dequeue!(q)
6565
for child in temp.children
6666
enqueue!(q, child)

0 commit comments

Comments
 (0)