Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
This site is slowly being migrated into dsapanicle.com
DSA Panicle
Logo

Array & String

  • Sliding Window
    • Fixed Window
    • Longest Sub{string,array}
    • Shortest Sub{string,array}
    • Return Count,Indices
  • One Pass
  • Two Pointers
    • Read Write Heads
    • Left Right Heads
    • 2 Heads for 2 Arrays

Search & Sort

  • Binary Search
    • O(logN) , O(sort)
    • Secondary loop BS
    • Monotone Function, O(NlogN)

Tree

  • Binary Tree
    • Level, Height, Depth
    • Path
    • Side Views, Two Trees
    • Recursion with Return
    • Manipulate Tree
  • N-ary Tree
    • All Traversals
  • Binary Search Tree
    • Manipulate Tree
    • All Traversals

Design & Simulation

  • Array, Hash

Dynamic Programming

  • Fibonacci series
  • Longest Subsequence

Maths & Bits

  • Bit Manipulation
  • Math
Back to top
View this page
Edit this page

Binary Tree¶

Table of Content

  • Level, Height, Depth
    • Categorize
  • Path
    • Math in it: Bitwise, Divmod
  • Side Views, Two Trees
    • Two Trees
  • Recursion with Return
    • Recursion with Return
  • Manipulate Tree
    • Create a new tree

Print Values of Nodes¶

nprint = lambda *l: print(", ".join(str(i.val if i else "None") for i in l))
# Usage Examples
nprint(node)
nprint(node1, node2, ...)
Next
Level, Height, Depth
Previous
Monotone Function, O(NlogN)
Copyright © 2024, Abhishek R
Made with Sphinx and @pradyunsg's Furo
On this page
  • Binary Tree
    • Print Values of Nodes