Method: Heap#find
- Defined in:
- lib/data_structures/heap.rb
#find(el) ⇒ Object
81 82 83 84 85 |
# File 'lib/data_structures/heap.rb', line 81 def find(el) return nil if @store.empty? || el < @store.first @store.each { |store_el| return store_el if store_el == el } nil end |