lib/treemap/tree_map.rb
def next_node
      return @right.first if @right

      node = self
      parent = node.parent
      while parent
        if parent.left == node
          return parent
        end
        node = parent
        parent = node.parent
      end
      nil
    end
# Returns the next node in an inorder traversal, or null if this is the last node in the tree.
Returns the next node in an inorder traversal, or null if this is the last node in the tree.
Returns the next node in an inorder traversal or null if this is the last node in the tree .
def next_node
      return @right.first if @right
      node = self
      parent = node.parent
      while parent
        if parent.left == node
          return parent
        end
        node = parent
        parent = node.parent
      end
      nil
    end
def next_node return @right . first if @right node = self parent = node . parent while parent if parent . left == node return parent end node = parent parent = node . parent end nil end
Returns the next node in an inorder traversal, or null if this is the last node in the tree.
Returns the next node in an inorder traversal or null if this is the last node in the tree .