Function result of pushing nodes elements into tree tree where parent is index and parent distance is distance

tree

Format:

result of pushing nodes elements into tree tree where parent is index and parent distance is distance

Input:

list tree -
number index -
number distance -
list elements -

Output:

list - None

Properties that reference this function:

result of pushing nodes [ pair (value, weight), rest ] into tree tree where parent is index and parent distance is distance = result of pushing nodes rest into tree [ node (value, (distance + weight), index), tree ] where parent is index and parent distance is distance (push children node)
result of pushing nodes [ ] into tree tree where parent is index and parent distance is distance = tree (push children nodes finished)

Conditional properties that reference this function:

  • if the following are true:
    • ((length of stack tree) - 1) - index = back_i
    • the element at index back_i of stack tree = node (value, distance, previous)
    • result of splitting pairs into nodes that exist in the tree tree and new nodes = pair (exists, new)
    • result of updating nodes exists in tree tree with parent index index and parent distance distance = updated

    then result of adding or updating children pairs of the node at backwards index index in tree tree = result of pushing nodes new into tree updated where parent is index and parent distance is distance

    (link)


Comments

Please log in to add comments