Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def show_2d(self):
- a = self._tree.bfs_order_star()
- i = 1
- hojd_pa_trad = self._tree.height()
- just_nu_hojd = 0
- for p in range(len(a)):
- antal = 2**(hojd_pa_trad - just_nu_hojd - 1)
- for x in range(antal):
- print("\t", end='')
- print("{}".format(a[p] if a[p] is not None else "*" ), end = '')
- for x in range(antal):
- print("\t", end='')
- if p + 1 == i:
- print("\n")
- i = i * 2 + 1
- just_nu_hojd = just_nu_hojd + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement