victory 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -0
- data/.rubocop.yml +11 -1
- data/README.md +4 -6
- data/Rakefile +11 -4
- data/USAGE.md +159 -0
- data/ext/algorithms/string/LICENSE.md +21 -0
- data/ext/algorithms/string/extconf.rb +4 -0
- data/ext/algorithms/string/string.c +68 -0
- data/ext/containers/bst/LICENSE.md +21 -0
- data/ext/containers/bst/bst.c +247 -0
- data/ext/containers/bst/extconf.rb +4 -0
- data/ext/containers/deque/LICENSE.md +21 -0
- data/ext/containers/deque/deque.c +247 -0
- data/ext/containers/deque/extconf.rb +4 -0
- data/ext/containers/rbtree_map/LICENSE.md +21 -0
- data/ext/containers/rbtree_map/extconf.rb +4 -0
- data/ext/containers/rbtree_map/rbtree.c +498 -0
- data/ext/containers/splaytree_map/LICENSE.md +21 -0
- data/ext/containers/splaytree_map/extconf.rb +4 -0
- data/ext/containers/splaytree_map/splaytree.c +419 -0
- data/ext/containers/xor_list/extconf.rb +4 -0
- data/ext/containers/xor_list/xor_list.c +122 -0
- data/lib/algorithms/search.rb +104 -0
- data/lib/algorithms/sort.rb +389 -0
- data/lib/algorithms/string.rb +29 -0
- data/lib/containers/deque.rb +193 -0
- data/lib/containers/heap.rb +524 -0
- data/lib/containers/kd_tree.rb +131 -0
- data/lib/containers/list.rb +81 -0
- data/lib/containers/prefix_tree.rb +61 -0
- data/lib/containers/priority_queue.rb +135 -0
- data/lib/containers/queue.rb +89 -0
- data/lib/containers/rb_tree_map.rb +420 -0
- data/lib/containers/splay_tree_map.rb +290 -0
- data/lib/containers/stack.rb +88 -0
- data/lib/containers/suffix_array.rb +92 -0
- data/lib/containers/trie.rb +204 -0
- data/lib/containers/tuple.rb +20 -0
- data/lib/victory/version.rb +1 -1
- data/lib/victory.rb +8 -1
- data/victory.gemspec +12 -3
- metadata +73 -12
- data/.idea/encodings.xml +0 -4
- data/.idea/misc.xml +0 -7
- data/.idea/modules.xml +0 -8
- data/.idea/victory.iml +0 -13
- data/.idea/workspace.xml +0 -233
- data/ext/victory/extconf.rb +0 -3
- data/ext/victory/victory.c +0 -9
- data/ext/victory/victory.h +0 -6
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'containers/deque'
|
2
|
+
# rdoc
|
3
|
+
# A Stack is a container that keeps elements in a last-in first-out (LIFO) order. There are many
|
4
|
+
# uses for stacks, including prefix-infix-postfix conversion and backtracking problems.
|
5
|
+
#
|
6
|
+
# This implementation uses a doubly-linked list, guaranteeing O(1) complexity for all operations.
|
7
|
+
#
|
8
|
+
#
|
9
|
+
# MIT License
|
10
|
+
#
|
11
|
+
# Copyright (c) 2009 Kanwei Li
|
12
|
+
#
|
13
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
14
|
+
# of this software and associated documentation files (the "Software"), to deal
|
15
|
+
# in the Software without restriction, including without limitation the rights
|
16
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
17
|
+
# copies of the Software, and to permit persons to whom the Software is
|
18
|
+
# furnished to do so, subject to the following conditions:
|
19
|
+
#
|
20
|
+
# The above copyright notice and this permission notice shall be included in all
|
21
|
+
# copies or substantial portions of the Software.
|
22
|
+
#
|
23
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
24
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
25
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
26
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
27
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
28
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
29
|
+
# SOFTWARE.
|
30
|
+
class Containers::Stack
|
31
|
+
include Enumerable
|
32
|
+
# Create a new stack. Takes an optional array argument to initialize the stack.
|
33
|
+
#
|
34
|
+
# s = Containers::Stack.new([1, 2, 3])
|
35
|
+
# s.pop #=> 3
|
36
|
+
# s.pop #=> 2
|
37
|
+
def initialize(ary=[])
|
38
|
+
@container = Containers::Deque.new(ary)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Returns the next item from the stack but does not remove it.
|
42
|
+
#
|
43
|
+
# s = Containers::Stack.new([1, 2, 3])
|
44
|
+
# s.next #=> 3
|
45
|
+
# s.size #=> 3
|
46
|
+
def next
|
47
|
+
@container.back
|
48
|
+
end
|
49
|
+
|
50
|
+
# Adds an item to the stack.
|
51
|
+
#
|
52
|
+
# s = Containers::Stack.new([1])
|
53
|
+
# s.push(2)
|
54
|
+
# s.pop #=> 2
|
55
|
+
# s.pop #=> 1
|
56
|
+
def push(obj)
|
57
|
+
@container.push_back(obj)
|
58
|
+
end
|
59
|
+
alias_method :<<, :push
|
60
|
+
|
61
|
+
# Removes the next item from the stack and returns it.
|
62
|
+
#
|
63
|
+
# s = Containers::Stack.new([1, 2, 3])
|
64
|
+
# s.pop #=> 3
|
65
|
+
# s.size #=> 2
|
66
|
+
def pop
|
67
|
+
@container.pop_back
|
68
|
+
end
|
69
|
+
|
70
|
+
# Return the number of items in the stack.
|
71
|
+
#
|
72
|
+
# s = Containers::Stack.new([1, 2, 3])
|
73
|
+
# s.size #=> 3
|
74
|
+
def size
|
75
|
+
@container.size
|
76
|
+
end
|
77
|
+
|
78
|
+
# Returns true if the stack is empty, false otherwise.
|
79
|
+
def empty?
|
80
|
+
@container.empty?
|
81
|
+
end
|
82
|
+
|
83
|
+
# Iterate over the Stack in LIFO order.
|
84
|
+
def each(&block)
|
85
|
+
@container.each_backward(&block)
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# rdoc
|
4
|
+
# A suffix array enables fast substring search of a given string. An array of all possible substrings
|
5
|
+
# is constructed and stored, and a binary search is then done to find a desired substring among those
|
6
|
+
# stored. While more storage (and thus memory) is needed to create the SuffixArray, the advantage is
|
7
|
+
# that substrings can be found in O(m log n) time, where m is the length of the substring to search for
|
8
|
+
# and n is the total number of substrings.
|
9
|
+
#
|
10
|
+
#
|
11
|
+
# MIT License
|
12
|
+
#
|
13
|
+
# Copyright (c) 2009 Kanwei Li
|
14
|
+
#
|
15
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
16
|
+
# of this software and associated documentation files (the "Software"), to deal
|
17
|
+
# in the Software without restriction, including without limitation the rights
|
18
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
19
|
+
# copies of the Software, and to permit persons to whom the Software is
|
20
|
+
# furnished to do so, subject to the following conditions:
|
21
|
+
#
|
22
|
+
# The above copyright notice and this permission notice shall be included in all
|
23
|
+
# copies or substantial portions of the Software.
|
24
|
+
#
|
25
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
26
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
27
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
28
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
29
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
30
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
31
|
+
# SOFTWARE.
|
32
|
+
class Containers::SuffixArray
|
33
|
+
# Creates a new SuffixArray with a given string. Object of any class implementing a #to_s method can
|
34
|
+
# be passed in, such as integers.
|
35
|
+
#
|
36
|
+
# Complexity: O(n^2 log n)
|
37
|
+
#
|
38
|
+
# s_array = Containers::SuffixArray("abracadabra")
|
39
|
+
# s_array["abra"] #=> true
|
40
|
+
#
|
41
|
+
# number = Containers::SuffixArray(1234567)
|
42
|
+
# number[1] #=> true
|
43
|
+
# number[13] #=> false
|
44
|
+
def initialize(string)
|
45
|
+
string = string.to_s
|
46
|
+
raise ArgumentError, 'SuffixArray needs to be initialized with a non-empty string' if string.empty?
|
47
|
+
@original_string = string
|
48
|
+
@suffixes = []
|
49
|
+
string.length.times do |i|
|
50
|
+
@suffixes << string[i..-1]
|
51
|
+
end
|
52
|
+
|
53
|
+
# Sort the suffixes in ascending order
|
54
|
+
@suffixes.sort! { |x, y| x <=> y }
|
55
|
+
end
|
56
|
+
|
57
|
+
# Returns true if the substring occurs in the string, false otherwise.
|
58
|
+
#
|
59
|
+
# Complexity: O(m + log n)
|
60
|
+
#
|
61
|
+
# s_array = Containers::SuffixArray.new("abracadabra")
|
62
|
+
# s_array.has_substring?("a") #=> true
|
63
|
+
# s_array.has_substring?("abra") #=> true
|
64
|
+
# s_array.has_substring?("abracadabra") #=> true
|
65
|
+
# s_array.has_substring?("acadabra") #=> true
|
66
|
+
# s_array.has_substring?("adabra") #=> true
|
67
|
+
# s_array.has_substring?("bra") #=> true
|
68
|
+
# s_array.has_substring?("bracadabra") #=> true
|
69
|
+
# s_array.has_substring?("cadabra") #=> true
|
70
|
+
# s_array.has_substring?("dabra") #=> true
|
71
|
+
# s_array.has_substring?("ra") #=> true
|
72
|
+
# s_array.has_substring?("racadabra") #=> true
|
73
|
+
# s_array.has_substring?("nope") #=> false
|
74
|
+
def has_substring?(substring)
|
75
|
+
substring = substring.to_s
|
76
|
+
return false if substring.empty?
|
77
|
+
substring_length = substring.length-1
|
78
|
+
l = 0
|
79
|
+
r = @suffixes.size-1
|
80
|
+
while(l <= r)
|
81
|
+
mid = (l + r) / 2
|
82
|
+
suffix = @suffixes[mid][0..substring_length]
|
83
|
+
case substring <=> suffix
|
84
|
+
when 0 then return true
|
85
|
+
when 1 then l = mid + 1
|
86
|
+
when -1 then r = mid - 1
|
87
|
+
end
|
88
|
+
end
|
89
|
+
false
|
90
|
+
end
|
91
|
+
alias [] has_substring?
|
92
|
+
end
|
@@ -0,0 +1,204 @@
|
|
1
|
+
# rdoc
|
2
|
+
# A Trie is a data structure that stores key value pairs in a tree-like fashion. It allows
|
3
|
+
# O(m) lookup speed, where m is the length of the key searched, and has no chance of collisions,
|
4
|
+
# unlike hash tables. Because of its nature, search misses are quickly detected.
|
5
|
+
#
|
6
|
+
# Tries are often used for longest prefix algorithms, wildcard matching, and can be used to
|
7
|
+
# implement a radix sort.
|
8
|
+
#
|
9
|
+
# This implemention is based on a Ternary Search Tree.
|
10
|
+
#
|
11
|
+
#
|
12
|
+
# MIT License
|
13
|
+
#
|
14
|
+
# Copyright (c) 2009 Kanwei Li
|
15
|
+
#
|
16
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
17
|
+
# of this software and associated documentation files (the "Software"), to deal
|
18
|
+
# in the Software without restriction, including without limitation the rights
|
19
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
20
|
+
# copies of the Software, and to permit persons to whom the Software is
|
21
|
+
# furnished to do so, subject to the following conditions:
|
22
|
+
#
|
23
|
+
# The above copyright notice and this permission notice shall be included in all
|
24
|
+
# copies or substantial portions of the Software.
|
25
|
+
#
|
26
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
27
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
28
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
29
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
30
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
31
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
32
|
+
# SOFTWARE.
|
33
|
+
class Containers::Trie
|
34
|
+
# Create a new, empty Trie.
|
35
|
+
#
|
36
|
+
# t = Containers::Trie.new
|
37
|
+
# t["hello"] = "world"
|
38
|
+
# t["hello"] #=> "world"
|
39
|
+
def initialize
|
40
|
+
@root = nil
|
41
|
+
end
|
42
|
+
|
43
|
+
# Adds a key, value pair to the Trie, and returns the value if successful. The to_s method is
|
44
|
+
# called on the parameter to turn it into a string.
|
45
|
+
#
|
46
|
+
# Complexity: O(m)
|
47
|
+
#
|
48
|
+
# t = Containers::Trie.new
|
49
|
+
# t["hello"] = "world"
|
50
|
+
# t.push("hello", "world") # does the same thing
|
51
|
+
# t["hello"] #=> "world"
|
52
|
+
# t[1] = 1
|
53
|
+
# t[1] #=> 1
|
54
|
+
def push(key, value)
|
55
|
+
key = key.to_s
|
56
|
+
return nil if key.empty?
|
57
|
+
@root = push_recursive(@root, key, 0, value)
|
58
|
+
value
|
59
|
+
end
|
60
|
+
alias_method :[]=, :push
|
61
|
+
|
62
|
+
# Returns true if the key is contained in the Trie.
|
63
|
+
#
|
64
|
+
# Complexity: O(m) worst case
|
65
|
+
#
|
66
|
+
def has_key?(key)
|
67
|
+
key = key.to_s
|
68
|
+
return false if key.empty?
|
69
|
+
!(get_recursive(@root, key, 0).nil?)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Returns the value of the desired key, or nil if the key doesn't exist.
|
73
|
+
#
|
74
|
+
# Complexity: O(m) worst case
|
75
|
+
#
|
76
|
+
# t = Containers::Trie.new
|
77
|
+
# t.get("hello") = "world"
|
78
|
+
# t.get("non-existant") #=> nil
|
79
|
+
def get(key)
|
80
|
+
key = key.to_s
|
81
|
+
return nil if key.empty?
|
82
|
+
node = get_recursive(@root, key, 0)
|
83
|
+
node ? node.last : nil
|
84
|
+
end
|
85
|
+
alias_method :[], :get
|
86
|
+
|
87
|
+
# Returns the longest key that has a prefix in common with the parameter string. If
|
88
|
+
# no match is found, the blank string "" is returned.
|
89
|
+
#
|
90
|
+
# Complexity: O(m) worst case
|
91
|
+
#
|
92
|
+
# t = Containers::Trie.new
|
93
|
+
# t.push("Hello", "World")
|
94
|
+
# t.push("Hello, brother", "World")
|
95
|
+
# t.push("Hello, bob", "World")
|
96
|
+
# t.longest_prefix("Hello, brandon") #=> "Hello"
|
97
|
+
# t.longest_prefix("Hel") #=> ""
|
98
|
+
# t.longest_prefix("Hello") #=> "Hello"
|
99
|
+
def longest_prefix(string)
|
100
|
+
string = string.to_s
|
101
|
+
return nil if string.empty?
|
102
|
+
len = prefix_recursive(@root, string, 0)
|
103
|
+
string[0...len]
|
104
|
+
end
|
105
|
+
|
106
|
+
# Returns a sorted array containing strings that match the parameter string. The wildcard
|
107
|
+
# characters that match any character are '*' and '.' If no match is found, an empty
|
108
|
+
# array is returned.
|
109
|
+
#
|
110
|
+
# Complexity: O(n) worst case
|
111
|
+
#
|
112
|
+
# t = Containers::Trie.new
|
113
|
+
# t.push("Hello", "World")
|
114
|
+
# t.push("Hilly", "World")
|
115
|
+
# t.push("Hello, bob", "World")
|
116
|
+
# t.wildcard("H*ll.") #=> ["Hello", "Hilly"]
|
117
|
+
# t.wildcard("Hel") #=> []
|
118
|
+
def wildcard(string)
|
119
|
+
string = string.to_s
|
120
|
+
return nil if string.empty?
|
121
|
+
ary = []
|
122
|
+
ary << wildcard_recursive(@root, string, 0, "")
|
123
|
+
ary.flatten.compact.sort
|
124
|
+
end
|
125
|
+
|
126
|
+
class Node # :nodoc: all
|
127
|
+
attr_accessor :left, :mid, :right, :char, :value, :end
|
128
|
+
|
129
|
+
def initialize(char, value)
|
130
|
+
@char = char
|
131
|
+
@value = value
|
132
|
+
@left = @mid = @right = nil
|
133
|
+
@end = false
|
134
|
+
end
|
135
|
+
|
136
|
+
def last?
|
137
|
+
@end == true
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
def wildcard_recursive(node, string, index, prefix)
|
142
|
+
return nil if node.nil? || index == string.length
|
143
|
+
arr = []
|
144
|
+
char = string[index]
|
145
|
+
if (char.chr == "*" || char.chr == "." || char < node.char)
|
146
|
+
arr << wildcard_recursive(node.left, string, index, prefix)
|
147
|
+
end
|
148
|
+
if (char.chr == "*" || char.chr == "." || char > node.char)
|
149
|
+
arr << wildcard_recursive(node.right, string, index, prefix)
|
150
|
+
end
|
151
|
+
if (char.chr == "*" || char.chr == "." || char == node.char)
|
152
|
+
arr << "#{prefix}#{node.char.chr}" if node.last?
|
153
|
+
arr << wildcard_recursive(node.mid, string, index+1, prefix + node.char.chr)
|
154
|
+
end
|
155
|
+
arr
|
156
|
+
end
|
157
|
+
|
158
|
+
def prefix_recursive(node, string, index)
|
159
|
+
return 0 if node.nil? || index == string.length
|
160
|
+
len = 0
|
161
|
+
rec_len = 0
|
162
|
+
char = string[index]
|
163
|
+
if (char < node.char)
|
164
|
+
rec_len = prefix_recursive(node.left, string, index)
|
165
|
+
elsif (char > node.char)
|
166
|
+
rec_len = prefix_recursive(node.right, string, index)
|
167
|
+
else
|
168
|
+
len = index+1 if node.last?
|
169
|
+
rec_len = prefix_recursive(node.mid, string, index+1)
|
170
|
+
end
|
171
|
+
len > rec_len ? len : rec_len
|
172
|
+
end
|
173
|
+
|
174
|
+
def push_recursive(node, string, index, value)
|
175
|
+
char = string[index]
|
176
|
+
node = Node.new(char, value) if node.nil?
|
177
|
+
if (char < node.char)
|
178
|
+
node.left = push_recursive(node.left, string, index, value)
|
179
|
+
elsif (char > node.char)
|
180
|
+
node.right = push_recursive(node.right, string, index, value)
|
181
|
+
elsif (index < string.length-1) # We're not at the end of the input string; add next char
|
182
|
+
node.mid = push_recursive(node.mid, string, index+1, value)
|
183
|
+
else
|
184
|
+
node.end = true
|
185
|
+
node.value = value
|
186
|
+
end
|
187
|
+
node
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns [char, value] if found
|
191
|
+
def get_recursive(node, string, index)
|
192
|
+
return nil if node.nil?
|
193
|
+
char = string[index]
|
194
|
+
if (char < node.char)
|
195
|
+
return get_recursive(node.left, string, index)
|
196
|
+
elsif (char > node.char)
|
197
|
+
return get_recursive(node.right, string, index)
|
198
|
+
elsif (index < string.length-1) # We're not at the end of the input string; add next char
|
199
|
+
return get_recursive(node.mid, string, index+1)
|
200
|
+
else
|
201
|
+
return node.last? ? [node.char, node.value] : nil
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
data/lib/victory/version.rb
CHANGED
data/lib/victory.rb
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
require "victory/version"
|
2
|
-
require
|
2
|
+
require 'require_all'
|
3
3
|
|
4
4
|
module Victory
|
5
5
|
class Error < StandardError; end
|
6
6
|
# Your code goes here...
|
7
7
|
end
|
8
|
+
|
9
|
+
module Algorithms; end
|
10
|
+
module Containers; end
|
11
|
+
|
12
|
+
require 'XORList'
|
13
|
+
|
14
|
+
require_all 'lib/**/*rb'
|
data/victory.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ['Arnold Szederjesi']
|
10
10
|
spec.email = ['szederjesiarnold@gmail.com']
|
11
11
|
|
12
|
-
spec.summary = 'A gem providing all useful algorithms and data structures for contests'
|
12
|
+
spec.summary = 'A gem providing all useful algorithms and data structures for programming contests'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
|
15
15
|
# Specify which files should be added to the gem when it is released.
|
@@ -19,11 +19,20 @@ Gem::Specification.new do |spec|
|
|
19
19
|
end
|
20
20
|
spec.bindir = 'exe'
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
-
spec.require_paths = ['lib']
|
23
|
-
spec.extensions = [
|
22
|
+
spec.require_paths = ['lib', 'ext']
|
23
|
+
spec.extensions = [
|
24
|
+
'ext/algorithms/string/extconf.rb',
|
25
|
+
'ext/containers/bst/extconf.rb',
|
26
|
+
'ext/containers/deque/extconf.rb',
|
27
|
+
'ext/containers/rbtree_map/extconf.rb',
|
28
|
+
'ext/containers/splaytree_map/extconf.rb',
|
29
|
+
'ext/containers/xor_list/extconf.rb'
|
30
|
+
]
|
24
31
|
|
25
32
|
spec.add_development_dependency 'bundler', '~> 1.17'
|
26
33
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
27
34
|
spec.add_development_dependency 'rake', '~> 10.0'
|
28
35
|
spec.add_development_dependency 'rake-compiler'
|
36
|
+
spec.add_development_dependency 'require_all'
|
37
|
+
spec.add_development_dependency 'rspec'
|
29
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: victory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arnold Szederjesi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,20 +66,48 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: require_all
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
69
97
|
description:
|
70
98
|
email:
|
71
99
|
- szederjesiarnold@gmail.com
|
72
100
|
executables: []
|
73
101
|
extensions:
|
74
|
-
- ext/
|
102
|
+
- ext/algorithms/string/extconf.rb
|
103
|
+
- ext/containers/bst/extconf.rb
|
104
|
+
- ext/containers/deque/extconf.rb
|
105
|
+
- ext/containers/rbtree_map/extconf.rb
|
106
|
+
- ext/containers/splaytree_map/extconf.rb
|
107
|
+
- ext/containers/xor_list/extconf.rb
|
75
108
|
extra_rdoc_files: []
|
76
109
|
files:
|
77
110
|
- ".gitignore"
|
78
|
-
- ".idea/encodings.xml"
|
79
|
-
- ".idea/misc.xml"
|
80
|
-
- ".idea/modules.xml"
|
81
|
-
- ".idea/victory.iml"
|
82
|
-
- ".idea/workspace.xml"
|
83
111
|
- ".rubocop.yml"
|
84
112
|
- ".travis.yml"
|
85
113
|
- CODE_OF_CONDUCT.md
|
@@ -87,11 +115,42 @@ files:
|
|
87
115
|
- LICENSE.txt
|
88
116
|
- README.md
|
89
117
|
- Rakefile
|
118
|
+
- USAGE.md
|
90
119
|
- bin/console
|
91
120
|
- bin/setup
|
92
|
-
- ext/
|
93
|
-
- ext/
|
94
|
-
- ext/
|
121
|
+
- ext/algorithms/string/LICENSE.md
|
122
|
+
- ext/algorithms/string/extconf.rb
|
123
|
+
- ext/algorithms/string/string.c
|
124
|
+
- ext/containers/bst/LICENSE.md
|
125
|
+
- ext/containers/bst/bst.c
|
126
|
+
- ext/containers/bst/extconf.rb
|
127
|
+
- ext/containers/deque/LICENSE.md
|
128
|
+
- ext/containers/deque/deque.c
|
129
|
+
- ext/containers/deque/extconf.rb
|
130
|
+
- ext/containers/rbtree_map/LICENSE.md
|
131
|
+
- ext/containers/rbtree_map/extconf.rb
|
132
|
+
- ext/containers/rbtree_map/rbtree.c
|
133
|
+
- ext/containers/splaytree_map/LICENSE.md
|
134
|
+
- ext/containers/splaytree_map/extconf.rb
|
135
|
+
- ext/containers/splaytree_map/splaytree.c
|
136
|
+
- ext/containers/xor_list/extconf.rb
|
137
|
+
- ext/containers/xor_list/xor_list.c
|
138
|
+
- lib/algorithms/search.rb
|
139
|
+
- lib/algorithms/sort.rb
|
140
|
+
- lib/algorithms/string.rb
|
141
|
+
- lib/containers/deque.rb
|
142
|
+
- lib/containers/heap.rb
|
143
|
+
- lib/containers/kd_tree.rb
|
144
|
+
- lib/containers/list.rb
|
145
|
+
- lib/containers/prefix_tree.rb
|
146
|
+
- lib/containers/priority_queue.rb
|
147
|
+
- lib/containers/queue.rb
|
148
|
+
- lib/containers/rb_tree_map.rb
|
149
|
+
- lib/containers/splay_tree_map.rb
|
150
|
+
- lib/containers/stack.rb
|
151
|
+
- lib/containers/suffix_array.rb
|
152
|
+
- lib/containers/trie.rb
|
153
|
+
- lib/containers/tuple.rb
|
95
154
|
- lib/victory.rb
|
96
155
|
- lib/victory/version.rb
|
97
156
|
- victory.gemspec
|
@@ -103,6 +162,7 @@ post_install_message:
|
|
103
162
|
rdoc_options: []
|
104
163
|
require_paths:
|
105
164
|
- lib
|
165
|
+
- ext
|
106
166
|
required_ruby_version: !ruby/object:Gem::Requirement
|
107
167
|
requirements:
|
108
168
|
- - ">="
|
@@ -117,5 +177,6 @@ requirements: []
|
|
117
177
|
rubygems_version: 3.0.1
|
118
178
|
signing_key:
|
119
179
|
specification_version: 4
|
120
|
-
summary: A gem providing all useful algorithms and data structures for
|
180
|
+
summary: A gem providing all useful algorithms and data structures for programming
|
181
|
+
contests
|
121
182
|
test_files: []
|
data/.idea/encodings.xml
DELETED
data/.idea/misc.xml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="JavaScriptSettings">
|
4
|
-
<option name="languageLevel" value="ES6" />
|
5
|
-
</component>
|
6
|
-
<component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.6.0" project-jdk-type="RUBY_SDK" />
|
7
|
-
</project>
|
data/.idea/modules.xml
DELETED
data/.idea/victory.iml
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<module type="RUBY_MODULE" version="4">
|
3
|
-
<component name="ModuleRunConfigurationManager">
|
4
|
-
<shared />
|
5
|
-
</component>
|
6
|
-
<component name="NewModuleRootManager">
|
7
|
-
<content url="file://$MODULE_DIR$" />
|
8
|
-
<orderEntry type="inheritedJdk" />
|
9
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
10
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.17.2, RVM: ruby-2.6.0) [gem]" level="application" />
|
11
|
-
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.11.3, RVM: ruby-2.6.0) [gem]" level="application" />
|
12
|
-
</component>
|
13
|
-
</module>
|