Module: Trees::Binary::SearchHelpers
- Included in:
- Node
- Defined in:
- lib/trees/binary/search_heplers.rb
Instance Method Summary collapse
Instance Method Details
#include?(value) ⇒ Boolean
4 5 6 7 8 9 10 |
# File 'lib/trees/binary/search_heplers.rb', line 4 def include?(value) case data <=> value when 1 then left.include? value when -1 then right.include? value when 0 then true end end |