SHARE
TWEET

Untitled




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- def topView(root):
- if root.left:
- printleftside(root.left)
- print(root.info, end=' ')
- if root.right:
- printrightside(root.right)
- def printleftside(node):
- if node:
- printleftside(node.left)
- else:
- return
- print(node.info, end=' ')
- def printrightside(node):
- if node:
- print(node.info, end=' ')
- printrightside(node.right)
- else:
- return
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.