Class: Heap::BinaryHeap::MinHeap

Inherits:
BinaryHeap show all
Defined in:
lib/Heap/binary_heap/binary_heap_min.rb

Overview

Binary Heap with min root

Instance Attribute Summary

Attributes inherited from HeapTemplate

#elements

Instance Method Summary collapse

Methods inherited from HeapTemplate

#add, #count, #sort

Instance Method Details

#extract_minObject



5
6
7
# File 'lib/Heap/binary_heap/binary_heap_min.rb', line 5

def extract_min
  extract_root
end

#extract_min!Object



9
10
11
# File 'lib/Heap/binary_heap/binary_heap_min.rb', line 9

def extract_min!
  extract_root!
end