class BinaryTreeStruct
Attributes
root[RW]
Public Class Methods
new(val)
click to toggle source
# File lib/binary_tree_struct.rb, line 26 def initialize(val) self.root = Node.new(val) end
Public Instance Methods
insert(val)
click to toggle source
# File lib/binary_tree_struct.rb, line 34 def insert(val) self.root.traverse(val) end
search(val)
click to toggle source
# File lib/binary_tree_struct.rb, line 30 def search(val) self.root.traverse(val, :search) end