/lc-binary-tree

Binary tree from array

Primary LanguagePython

Binary Tree from Array

An implementation of binary tree creation from the array compact representation (LeetCode).

Usage example:

>>> arr = [1, 2, 3, None, 4, None, None, 5, 6, None, 7]
>>> build_tree(arr)
(1)
  (2)
    (4)
      (5)
        (7)
      (6)
  (3)