Skip to content

Instantly share code, notes, and snippets.

View roadhouse's full-sized avatar

Jean Uchôa roadhouse

View GitHub Profile
@roadhouse
roadhouse / code.ruby
Created June 28, 2023 14:53 — forked from cleicar/code.ruby
Get the largest branch in a Binary Tree in Ruby
class BinaryTree
def initialize
@root = nil
@left_nodes = []
@right_nodes = []
end
def insert(value)
@root.nil? ? @root = TreeNode.new(value) : @root.insert(value)
end