Skip to content

Instantly share code, notes, and snippets.

@andrewsouthard1
Last active May 17, 2017 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewsouthard1/9219269cfa6858f2c5250c529a345d67 to your computer and use it in GitHub Desktop.
Save andrewsouthard1/9219269cfa6858f2c5250c529a345d67 to your computer and use it in GitHub Desktop.
Find the smallest node in a tree
def find_smallest(node)
current = node
while current
return current.value if !current.left
current = current.left
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment