from collections import deque
class Solution:
#Function to return the level order traversal of a tree.
def levelOrder(self,root):
# Code here
if root is None:
return []
q=deque()
out=[]
q.append(root)
while q:
front = q.popleft()
out.append(front.data)
if front.left:
q.append(front.left)
if front.right:
q.append(front.right)
return out
-
Notifications
You must be signed in to change notification settings - Fork 0
vishnuvardhanreddy31/GFG_POTD_SOLUTIONS
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published