ruby_collections 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40967d38f6f24031a906eacfe04da66832a1ab87
4
- data.tar.gz: bcb19da4c5ea3878e25d34ea52feab31c3544dc6
3
+ metadata.gz: 711f86e8d08effa34645af0d1f43560623b7e7ce
4
+ data.tar.gz: 017ef4bd0f90379add0bd4653751206eac952ba7
5
5
  SHA512:
6
- metadata.gz: 90b1f34037c070be00851cd498e9ce75a7253752e133e3e2e6350b92ae27befd14389b93fbc4eae503af2dc37ac7283596aecf9d4d908054811e915f2ff56e2c
7
- data.tar.gz: 8017d6c72f7702fcba6c6817a80feaf39365a4e443ae7bcf26d6592cb90f39b0ca1cd1d923d7a35d21232453fdee45cfe1c1c1aa452f1889ca12dc2f4d2e2364
6
+ metadata.gz: c1dcf3c5db4301b54cac67e4f17f179ca7b2e86db7fd53ed2dddea504355751e21e79e683a3f4232d752f60086aa22462962baa1358fbd9f7c9427c399dc805a
7
+ data.tar.gz: e01f04a2860777d3fe4713cacaca963097de07e7c39e503c18bda965b5c8a5974652c58bb695578ccfccb9dee4218be315a6cc4860efe904df33e5c6326cd286
data/README.md CHANGED
@@ -22,6 +22,10 @@ Or install it yourself as:
22
22
 
23
23
  Supported Data Structures: Max Heap, Min Heap
24
24
 
25
+ ### RubyCollections::MaxHeap
26
+
27
+ ```ruby
28
+
25
29
  max_heap = RubyCollections::MaxHeap.new
26
30
 
27
31
  max_heap.insert(1)
@@ -30,11 +34,13 @@ max_heap.insert(4)
30
34
 
31
35
  max_heap.heap # => [nil, 1, 4]
32
36
 
33
- max_heap.min # => 1
37
+ max_heap.max # => 4
34
38
 
35
- max_heap.extract_min # => 1
39
+ max_heap.extract_max # => 4
36
40
 
37
- max_heap.min # => 4
41
+ max_heap.max # => 1
42
+
43
+ ```
38
44
 
39
45
  Similarly we can use MinHeap as well.
40
46
 
@@ -1,3 +1,3 @@
1
1
  module RubyCollections
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_collections
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vikash Vikram