title: How to convert a flat list to a binary tree
body: <p>Let's say I have a list like so:</p>
  
  <pre><code>flat_list = [None, 10, 5, 15, None, None, 11, 22] 
  </code></pre>
  
  <p>I know the algorithm for creating a tree from a nestled list goes like:</p>
  
  <pre><code>def create_tree_from_nested_list(node_list):
      if not node_list:
          return node_list
      d, l, r = node_list
      tree = BinaryTree(d)
      tree.set_left(create_tree_from_nested_list(l))
      tree.set_right(create_tree_from_nested_list(r))
      return tree
  </code></pre>
  
  <p>The output for the code above would be:</p>
  
  <pre><code>10
  (l)    5
  (r)    15
  (l)        11
  (r)        22
  </code></pre>
  
  <p>How would I go about creating a function to flat lists into trees so that the left ones are stored at index position <code>2*i</code> and the right ones are stored at index position <code>2 * i + 1</code> and the output is the same as the output for the nested list. Any help is appreciated.</p>