Function node (value, distance, index)
value
Format:
node (value, distance, index)
Input:
Output:
Properties that reference this function:
Conditional properties that reference this function:
if el = val, then index of value val in [ node (el, w, p), remain ] with current index idx = idx
(link)if not (el = val), then index of value val in [ node (el, w, p), remain ] with current index idx = index of value val in remain with current index (idx + 1)
(link)if elem = value, then tree [ node (elem, d, p), rest ] contains value = True
(link)if not (elem = value), then tree [ node (elem, d, p), rest ] contains value = tree rest contains value
(link)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)
then children of the node at backwards index index of tree tree in graph graph = output of the find_neighbors function where the input graph is graph, node is value, and children are [ ]
(link)if the following are true:
- the element at index child_i of stack tree = node (child_value, child_d, child_prev)
- distance + weight < child_d
- result of storing (node (child_value, (distance + weight), index)) at index child_i of stack tree = updated
then result of updating nodes [ pair (child_i, weight), rest ] in tree tree with parent index index and parent distance distance = result of updating nodes rest in tree updated with parent index index and parent distance distance
(link)if the following are true:
- the element at index child_i of stack tree = node (child_value, child_d, child_prev)
- distance + weight > child_d
then result of updating nodes [ pair (child_i, weight), rest ] in tree tree with parent index index and parent distance distance = result of updating nodes rest in tree tree with parent index index and parent distance distance
(link)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