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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cee1c06e078dc124212a3462d765d26ce5fbe16dd6b31ca6392388d8f51644c
4
- data.tar.gz: 491e3540ee5567752d208bb7b8502d1ee998b55e9664c66b5cf5fc17394e10e7
3
+ metadata.gz: d542bb52d6a148cc95802bfc5d84549e605b7077009343496e51a00d405bed05
4
+ data.tar.gz: b66ba40d7c3b4d29f108294e2623f85c48f52f1cdcfa7282191ed412d1877cf5
5
5
  SHA512:
6
- metadata.gz: a4a533a2053ae799f87df22b51ff93744e8128e0982239f3d6717bfb6f8ee8817d9c6ebffd6b4a2b478694a3f2f742fc4465eba242e5d2d0d23bfc0c881c1daa
7
- data.tar.gz: 4ffaed30fc92fca18dd258102a702f8fceb1a77594ac6b086c627e1a3ab8ae1ad6650295acd0fb423a6ce441b6b7ab686bb56ae9ff937448d031f319d937a427
6
+ metadata.gz: 3bacbfc0793cce5bb67c51b33a64a6a4bb91e0d2cdfea661e5ee5721433bdbc19b723724ebb54e86289b053e71740dcd4c70a7e02fbed998015cd4fa31728f67
7
+ data.tar.gz: f2ec4934f51e631750aea36af36fb33a4b2dc0fee95ec1b138a8e97c75952b341f9f235e17a12868bb9233e88f6bb4bcfff0800e47fefe417712ee9167d389b1
data/README.markdown CHANGED
@@ -1,4 +1,4 @@
1
- # algorithms [![Build Status](https://travis-ci.org/kanwei/algorithms.png)](https://travis-ci.org/kanwei/algorithms)
1
+ # algorithms [![Build Status](https://travis-ci.org/kanwei/algorithms.svg?branch=master)](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
- ### Original Proposal: ###
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.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 = "2021-04-04"
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'
@@ -75,13 +75,6 @@ class Containers::Heap
75
75
  end
76
76
  @size += 1
77
77
 
78
- arr = []
79
- w = @next.right
80
- until w == @next do
81
- arr << w.value
82
- w = w.right
83
- end
84
- arr << @next.value
85
78
  @stored[key] ||= []
86
79
  @stored[key] << node
87
80
  value
@@ -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 smallest key and returns the item. Returns nil
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.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: 2021-04-04 00:00:00.000000000 Z
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.1.2
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: []