Function find nearest largertree

find nearest larger tree

Format:

find nearest largertree

Input:

list tree -
number value -
number index -

Output:

number - None

Conditional properties that reference this function:

  • if the element at index i of stack tree = node (value, left, right), then find nearest largertree = find nearest largertree (link)
  • if the following are true:
    • val < a
    • the element at index i of stack tree = node (a, (-1), right)

    then find nearest largertree = i

    (link)
  • if the following are true:
    • val < a
    • the element at index i of stack tree = node (a, left, right)

    then find nearest largertree = find nearest largertree

    (link)
  • if the following are true:
    • val > a
    • the element at index i of stack tree = node (a, left, right)

    then find nearest largertree = find nearest largertree

    (link)
  • if the following are true:
    • val = a
    • the element at index i of stack tree = node (a, left, right)

    then find nearest largertree = find nearest largertree

    (link)


Comments

Please log in to add comments