'Traverses tree in search for leaf for insert, remembering parent nodes in path,
looks for last occurence of key if already in tree.'

def _find_leaf_to_insert(self, key):

    nodes_stack = [self.data_start]
    if (self.root_flag == 'l'):
        return (nodes_stack, [])
    else:
        (nr_of_elements, curr_child_flag) = self._read_node_nr_of_elements_and_children_flag(self.data_start)
        (curr_index, curr_pointer) = self._find_last_key_occurence_in_node(self.data_start, key, nr_of_elements)
        nodes_stack.append(curr_pointer)
        indexes = [curr_index]
        while (curr_child_flag == 'n'):
            (nr_of_elements, curr_child_flag) = self._read_node_nr_of_elements_and_children_flag(curr_pointer)
            (curr_index, curr_pointer) = self._find_last_key_occurence_in_node(curr_pointer, key, nr_of_elements)
            nodes_stack.append(curr_pointer)
            indexes.append(curr_index)
        return (nodes_stack, indexes)
