data_structures_rmolinari 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -4
  3. data/ext/cc.h +3879 -0
  4. data/ext/shared.h +33 -0
  5. metadata +3 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7682f6d3b0779f347ce0797f55f33b9d7dcc7bd9c2039fc2fd6f865eb72e085a
4
- data.tar.gz: d717e5e36f79ddc4ecb605a59b475b7114359dea7476445590deb300f7915bd4
3
+ metadata.gz: a41b03a0d46982d64fc1ec5648174df24c6c9b0593ff93354ad90fc65ff84e8e
4
+ data.tar.gz: 544aa69540c9cef54c4eb6402b260bafbbeddf7dc5e770bf428976c11161c58e
5
5
  SHA512:
6
- metadata.gz: c3ffd9a4f67f55b7a2df1c949cf2288c06fcae416d5ff03a10307a1b79c3dae1daa74e2576d5e190c989adeea47b046426fad8c3c64199aadf22ba500b317f36
7
- data.tar.gz: 8380d6117f2955da9362395f8315f5121b4f7afba2f69aabb1981a01b675cbbed81d07c10b5745409080c2588c92df3d676ec36efa128571234a74dceef0e20d
6
+ metadata.gz: 19efca577bb0c3c9524cf09b6f63c0e06beab70bfd20d1dbafa5034009be9bcb965ac5b8cee0ba0a39ecdcb646c401a54b363852a4572613941f7a34da174593
7
+ data.tar.gz: 05606e9c142a9bcb69a9fd555586b0ad8fe76bf7572af3dd82003de673d78b671b9a5edf1e5d4a2e4c7d5c6d5e41bef2ed1679573600725b74a25d4f3665c6ee
data/README.md CHANGED
@@ -9,6 +9,8 @@ as fast as possible.
9
9
 
10
10
  The code is available as a gem: https://rubygems.org/gems/data_structures_rmolinari.
11
11
 
12
+ It is distributed under the MIT license.
13
+
12
14
  ## Usage
13
15
 
14
16
  The right way to organize the code is not obvious to me. For now the data structures are all defined in the module
@@ -166,13 +168,13 @@ SegmentTree = DataStructuresRMolinari::SegmentTree # namespace module
166
168
 
167
169
  data = [1, -3, 2, 1, 5, -9]
168
170
 
169
- # Get a segment tree instance that will answer "max over this subinterval" questions about data.
171
+ # Get a segment tree instance that will answer "max over this subinterval?" questions about data.
170
172
  # Here we get one using the ruby implementation of the generic functionality.
171
173
  #
172
- # We offer :index_of_max as an alternative to :max. This will construct an instance that answers
173
- # questions of the form "an index of the maximum value over this subinterval".
174
+ # Put :index_of_max in place of :map to get an instance that returns "an index of the maximum value
175
+ # over this subinterval".
174
176
  #
175
- # To use the version written in C, put :c instead of :ruby.
177
+ # To use the generic code written in C, put :c instead of :ruby.
176
178
  seg_tree = SegmentTree.construct(data, :max, :ruby)
177
179
 
178
180
  seg_tree.max_on(0, 2) # => 2