mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 20:26:07 -04:00
Update and rename tree_bfs.py to bt_bfs.py
This commit is contained in:
parent
9d1aa92451
commit
070071e687
@ -2,11 +2,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# author: bt3gl
|
# author: bt3gl
|
||||||
|
|
||||||
# Given the root of a binary tree, return the level order traversal of its nodes' values.
|
|
||||||
# (i.e., from left to right, level by level).
|
|
||||||
|
|
||||||
|
def level_order(root: Optional[Node]) -> list[list[int]]:
|
||||||
def level_order(root: Optional[TreeNode]) -> list[list[int]]:
|
|
||||||
|
|
||||||
if root is None:
|
if root is None:
|
||||||
return []
|
return []
|
Loading…
x
Reference in New Issue
Block a user