algorithms 1.0.0 → 1.0.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.
- checksums.yaml +4 -4
- data/README.markdown +2 -2
- data/algorithms.gemspec +2 -2
- data/lib/containers/heap.rb +0 -7
- data/lib/containers/rb_tree_map.rb +2 -2
- data/lib/containers/suffix_array.rb +3 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d542bb52d6a148cc95802bfc5d84549e605b7077009343496e51a00d405bed05
|
4
|
+
data.tar.gz: b66ba40d7c3b4d29f108294e2623f85c48f52f1cdcfa7282191ed412d1877cf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bacbfc0793cce5bb67c51b33a64a6a4bb91e0d2cdfea661e5ee5721433bdbc19b723724ebb54e86289b053e71740dcd4c70a7e02fbed998015cd4fa31728f67
|
7
|
+
data.tar.gz: f2ec4934f51e631750aea36af36fb33a4b2dc0fee95ec1b138a8e97c75952b341f9f235e17a12868bb9233e88f6bb4bcfff0800e47fefe417712ee9167d389b1
|
data/README.markdown
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# algorithms [](https://travis-ci.org/github/kanwei/algorithms)
|
2
2
|
|
3
3
|
[API Documentation](http://kanwei.github.io/algorithms/)
|
4
4
|
|
@@ -8,7 +8,7 @@ Started as a [Google Summer of Code 2008](http://code.google.com/soc/2008/ruby/a
|
|
8
8
|
|
9
9
|
Written by [Kanwei Li](http://kanwei.com/), mentored by Austin Ziegler
|
10
10
|
|
11
|
-
|
11
|
+
## Original Proposal: ##
|
12
12
|
|
13
13
|
Using the right data structure or algorithm for the situation is an important
|
14
14
|
aspect of programming. In computer science literature, many data structures
|
data/algorithms.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "algorithms"
|
5
|
-
s.version = "1.0.
|
5
|
+
s.version = "1.0.1"
|
6
6
|
|
7
7
|
s.authors = ["Kanwei Li"]
|
8
8
|
s.email = "kanwei@gmail.com"
|
9
9
|
s.license = 'MIT'
|
10
|
-
s.date = "
|
10
|
+
s.date = "2023-11-11"
|
11
11
|
s.summary = "Useful algorithms and data structures for Ruby. Optional C extensions."
|
12
12
|
s.description = "Heap, Priority Queue, Deque, Stack, Queue, Red-Black Trees, Splay Trees, sorting algorithms, and more"
|
13
13
|
if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
|
data/lib/containers/heap.rb
CHANGED
@@ -15,7 +15,7 @@ require 'containers/stack'
|
|
15
15
|
explicitly used as well; their functionality is identical.
|
16
16
|
|
17
17
|
Most methods have O(log n) complexity.
|
18
|
-
|
18
|
+
|
19
19
|
=end
|
20
20
|
class Containers::RubyRBTreeMap
|
21
21
|
include Enumerable
|
@@ -160,7 +160,7 @@ class Containers::RubyRBTreeMap
|
|
160
160
|
result
|
161
161
|
end
|
162
162
|
|
163
|
-
# Deletes the item with the
|
163
|
+
# Deletes the item with the largest key and returns the item. Returns nil
|
164
164
|
# if key is not present.
|
165
165
|
#
|
166
166
|
# Complexity: O(log n)
|
@@ -12,10 +12,10 @@ class Containers::SuffixArray
|
|
12
12
|
#
|
13
13
|
# Complexity: O(n^2 log n)
|
14
14
|
#
|
15
|
-
# s_array = Containers::SuffixArray("abracadabra")
|
15
|
+
# s_array = Containers::SuffixArray.new("abracadabra")
|
16
16
|
# s_array["abra"] #=> true
|
17
17
|
#
|
18
|
-
# number = Containers::SuffixArray(1234567)
|
18
|
+
# number = Containers::SuffixArray.new(1234567)
|
19
19
|
# number[1] #=> true
|
20
20
|
# number[13] #=> false
|
21
21
|
def initialize(string)
|
@@ -65,4 +65,4 @@ class Containers::SuffixArray
|
|
65
65
|
return false
|
66
66
|
end
|
67
67
|
alias_method :[], :has_substring?
|
68
|
-
end
|
68
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: algorithms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kanwei Li
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Heap, Priority Queue, Deque, Stack, Queue, Red-Black Trees, Splay Trees,
|
14
14
|
sorting algorithms, and more
|
@@ -78,7 +78,7 @@ homepage: https://github.com/kanwei/algorithms
|
|
78
78
|
licenses:
|
79
79
|
- MIT
|
80
80
|
metadata: {}
|
81
|
-
post_install_message:
|
81
|
+
post_install_message:
|
82
82
|
rdoc_options:
|
83
83
|
- "--line-numbers"
|
84
84
|
- "--inline-source"
|
@@ -100,8 +100,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
|
-
rubygems_version: 3.
|
104
|
-
signing_key:
|
103
|
+
rubygems_version: 3.2.32
|
104
|
+
signing_key:
|
105
105
|
specification_version: 4
|
106
106
|
summary: Useful algorithms and data structures for Ruby. Optional C extensions.
|
107
107
|
test_files: []
|