Function node (value, children)

node with value: value

Format:

node (value, children)

Input:

number value -
list children -

Output:

node - None

Properties that reference this function:

result of pushing values [ a, rest ] to tree tree = result of pushing values rest to tree [ node (a, [ ]), tree ] (create children nodes)
spanning tree of graph graph starting at node v = output of the spanning_tree function where the input graph is graph, backwards index is 0, and the spanning tree is [ node (v, [ ]), [ ] ] (construct spanning tree begin)
spanning DFT tree of graph graph starting from v = output of the build_dft_tree function where input graph is graph, tree is [ ], and neighbor stack is [ node (v, None), [ ] ] (construct depth first search tree begin)
output of the make_nodes function where input values are [ v, rest ], parent is parent, and nodes are nodes = output of the make_nodes function where input values are rest, parent is parent, and nodes are [ node (v, parent), nodes ] (create nodes next)

Conditional properties that reference this function:

  • if elem = value, then tree [ node (elem, cs), rest ] contains value = True (link)
  • if not (elem = value), then tree [ node (elem, cs), 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, cs)

    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:
    • ((length of stack tree) - 1) - index = back_i
    • the element at index back_i of stack tree = node (value, cs)
    • elements of numbers that are not in tree tree = new_elements
    • result of storing (node (value, new_elements)) at index back_i of stack tree = updated

    then result of adding numbers to tree tree as children of the node at backwards index index = result of pushing values new_elements to tree updated

    (link)
  • if the following are true:
    • children of the node top in graph graph = children
    • elements of children that are not in tree tree = new_elements
    • nodes with values new_elements and parent top = final_elems
    • result of dumping final_elems to rest = new_stack

    then output of the build_dft_tree function where input graph is graph, tree is tree, and neighbor stack is [ node (top, parent), rest ] = output of the build_dft_tree function where input graph is graph, tree is [ node (top, parent), tree ], and neighbor stack is new_stack

    (link)


Comments

Please log in to add comments