Function result of building the BST from nodes nodes and moves moves

tree

Format:

result of building the BST from nodes nodes and moves moves

Input:

list nodes -
list moves -

Output:

number - None

Properties that reference this function:

result of building the BST from nodes [ n, [ node (a, None, right), others ] ] and moves [ "L", moves ] = result of building the BST from nodes [ node (a, n, right), others ] and moves moves (rebuild BST iterate)
result of building the BST from nodes [ n, [ node (a, left, None), others ] ] and moves [ "R", moves ] = result of building the BST from nodes [ node (a, left, n), others ] and moves moves (rebuild BST iterate 2)
result of building the BST from nodes [ node, [ ] ] and moves [ ] = node (rebuild BST finished)
output of the bst_delete function where input tree is (node (a, None, None)), value is a, visited is visited, and moves are [ move, rest ] = result of building the BST from nodes visited and moves rest (tree delete leaf)

Conditional properties that reference this function:

  • if val < a, then output of the bst_insert function where the input tree is (node (a, None, None)), value is val, visited is visited, and moves are moves = result of building the BST from nodes [ node (a, (node (val, None, None)), None), visited ] and moves moves (link)
  • if val > a, then output of the bst_insert function where the input tree is (node (a, None, None)), value is val, visited is visited, and moves are moves = result of building the BST from nodes [ node (a, None, (node (val, None, None))), visited ] and moves moves (link)
  • if val = b, then output of the bst_delete function where input tree is (node (a, (node (b, None, (node (c, cl, cr)))), right)), value is val, visited is visited, and moves are moves = result of building the BST from nodes [ node (a, (node (c, cl, cr)), right), visited ] and moves moves (link)
  • if the following are true:
    • val = a
    • tree = node (a, (node (l, ll, lr)), (node (r, rl, rr)))
    • smallest value in (node (r, rl, rr)) = near

    then output of the bst_delete function where input tree is tree, value is val, visited is visited, and moves are moves = result of building the BST from nodes [ result of updating the root of (result of removing near from tree tree) with near, visited ] and moves moves

    (link)


Comments

Please log in to add comments