grosser-algorithms 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +45 -0
- data/VERSION +1 -0
- data/ext/containers/bst/bst.c +249 -0
- data/ext/containers/bst/extconf.rb +4 -0
- data/grosser-algorithms.gemspec +4 -4
- data/rdoc/classes/Algorithms.html +221 -0
- data/rdoc/classes/Algorithms/Algorithms.html +115 -0
- data/rdoc/classes/Algorithms/Algorithms/Sort.html +569 -0
- data/rdoc/classes/Algorithms/Containers.html +162 -0
- data/rdoc/classes/Algorithms/Containers/Heap.html +690 -0
- data/rdoc/classes/Algorithms/Containers/KDTree.html +195 -0
- data/rdoc/classes/Algorithms/Containers/MaxHeap.html +238 -0
- data/rdoc/classes/Algorithms/Containers/MinHeap.html +238 -0
- data/rdoc/classes/Algorithms/Containers/PriorityQueue.html +456 -0
- data/rdoc/classes/Algorithms/Containers/Queue.html +363 -0
- data/rdoc/classes/Algorithms/Containers/RubyDeque.html +617 -0
- data/rdoc/classes/Algorithms/Containers/RubyRBTreeMap.html +662 -0
- data/rdoc/classes/Algorithms/Containers/RubySplayTreeMap.html +623 -0
- data/rdoc/classes/Algorithms/Containers/Stack.html +363 -0
- data/rdoc/classes/Algorithms/Containers/SuffixArray.html +246 -0
- data/rdoc/classes/Algorithms/Containers/Trie.html +555 -0
- data/rdoc/classes/Algorithms/Search.html +273 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/History_txt.html +281 -0
- data/rdoc/files/README_markdown.html +248 -0
- data/rdoc/files/lib/algorithms/search_rb.html +108 -0
- data/rdoc/files/lib/algorithms/sort_rb.html +108 -0
- data/rdoc/files/lib/algorithms/string_rb.html +115 -0
- data/rdoc/files/lib/algorithms_rb.html +252 -0
- data/rdoc/files/lib/containers/deque_rb.html +119 -0
- data/rdoc/files/lib/containers/heap_rb.html +124 -0
- data/rdoc/files/lib/containers/kd_tree_rb.html +135 -0
- data/rdoc/files/lib/containers/priority_queue_rb.html +108 -0
- data/rdoc/files/lib/containers/queue_rb.html +108 -0
- data/rdoc/files/lib/containers/rb_tree_map_rb.html +109 -0
- data/rdoc/files/lib/containers/splay_tree_map_rb.html +109 -0
- data/rdoc/files/lib/containers/stack_rb.html +108 -0
- data/rdoc/files/lib/containers/suffix_array_rb.html +113 -0
- data/rdoc/files/lib/containers/trie_rb.html +117 -0
- data/rdoc/fr_class_index.html +43 -0
- data/rdoc/fr_file_index.html +42 -0
- data/rdoc/fr_method_index.html +147 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/spec/bst_gc_mark_spec.rb +25 -0
- data/spec/bst_spec.rb +25 -0
- metadata +50 -3
@@ -0,0 +1,273 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Algorithms::Search</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Algorithms::Search</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/algorithms/search_rb.html">
|
59
|
+
lib/algorithms/search.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000001">binary_search</a>
|
84
|
+
<a href="#M000002">kmp_search</a>
|
85
|
+
<a href="#M000003">kmp_search</a>
|
86
|
+
</div>
|
87
|
+
</div>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
<!-- if includes -->
|
93
|
+
|
94
|
+
<div id="section">
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
<!-- if method_list -->
|
104
|
+
<div id="methods">
|
105
|
+
<h3 class="section-bar">Public Class methods</h3>
|
106
|
+
|
107
|
+
<div id="method-M000001" class="method-detail">
|
108
|
+
<a name="M000001"></a>
|
109
|
+
|
110
|
+
<div class="method-heading">
|
111
|
+
<a href="#M000001" class="method-signature">
|
112
|
+
<span class="method-name">binary_search</span><span class="method-args">(container, item)</span>
|
113
|
+
</a>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<div class="method-description">
|
117
|
+
<p>
|
118
|
+
Binary <a href="Search.html">Search</a>: This search finds an item in
|
119
|
+
log(n) time provided that the container is already sorted. The method
|
120
|
+
returns the item if it is found, or nil if it is not. If there are
|
121
|
+
duplicates, the first one found is returned, and this is not guaranteed to
|
122
|
+
be the smallest or largest item.
|
123
|
+
</p>
|
124
|
+
<p>
|
125
|
+
Complexity: O(lg N)
|
126
|
+
</p>
|
127
|
+
<pre>
|
128
|
+
Algorithms::Search.binary_search([1, 2, 3], 1) #=> 1
|
129
|
+
Algorithms::Search.binary_search([1, 2, 3], 4) #=> nil
|
130
|
+
</pre>
|
131
|
+
<p><a class="source-toggle" href="#"
|
132
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
133
|
+
<div class="method-source-code" id="M000001-source">
|
134
|
+
<pre>
|
135
|
+
<span class="ruby-comment cmt"># File lib/algorithms/search.rb, line 15</span>
|
136
|
+
15: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">binary_search</span>(<span class="ruby-identifier">container</span>, <span class="ruby-identifier">item</span>)
|
137
|
+
16: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">nil?</span>
|
138
|
+
17: <span class="ruby-identifier">low</span> = <span class="ruby-value">0</span>
|
139
|
+
18: <span class="ruby-identifier">high</span> = <span class="ruby-identifier">container</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
140
|
+
19: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">low</span> <span class="ruby-operator"><=</span> <span class="ruby-identifier">high</span>
|
141
|
+
20: <span class="ruby-identifier">mid</span> = (<span class="ruby-identifier">low</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">high</span>) <span class="ruby-operator">/</span> <span class="ruby-value">2</span>
|
142
|
+
21: <span class="ruby-identifier">val</span> = <span class="ruby-identifier">container</span>[<span class="ruby-identifier">mid</span>]
|
143
|
+
22: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">></span> <span class="ruby-identifier">item</span>
|
144
|
+
23: <span class="ruby-identifier">high</span> = <span class="ruby-identifier">mid</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
145
|
+
24: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">val</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">item</span>
|
146
|
+
25: <span class="ruby-identifier">low</span> = <span class="ruby-identifier">mid</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
147
|
+
26: <span class="ruby-keyword kw">else</span>
|
148
|
+
27: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span>
|
149
|
+
28: <span class="ruby-keyword kw">end</span>
|
150
|
+
29: <span class="ruby-keyword kw">end</span>
|
151
|
+
30: <span class="ruby-keyword kw">nil</span>
|
152
|
+
31: <span class="ruby-keyword kw">end</span>
|
153
|
+
</pre>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<div id="method-M000002" class="method-detail">
|
159
|
+
<a name="M000002"></a>
|
160
|
+
|
161
|
+
<div class="method-heading">
|
162
|
+
<a href="#M000002" class="method-signature">
|
163
|
+
<span class="method-name">kmp_search</span><span class="method-args">(string, substring)</span>
|
164
|
+
</a>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
<div class="method-description">
|
168
|
+
<p>
|
169
|
+
Knuth-Morris-Pratt Algorithm substring search algorithm: Efficiently finds
|
170
|
+
the starting position of a substring in a string. The algorithm calculates
|
171
|
+
the best position to resume searching from if a failure occurs.
|
172
|
+
</p>
|
173
|
+
<p>
|
174
|
+
The method returns the index of the starting position in the string where
|
175
|
+
the substring is found. If there is no match, nil is returned.
|
176
|
+
</p>
|
177
|
+
<p>
|
178
|
+
Complexity: O(n + k), where n is the length of the string and k is the
|
179
|
+
length of the substring.
|
180
|
+
</p>
|
181
|
+
<pre>
|
182
|
+
Algorithms::Search.kmp_search("ABC ABCDAB ABCDABCDABDE", "ABCDABD") #=> 15
|
183
|
+
Algorithms::Search.kmp_search("ABC ABCDAB ABCDABCDABDE", "ABCDEF") #=> nil
|
184
|
+
</pre>
|
185
|
+
<p><a class="source-toggle" href="#"
|
186
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
187
|
+
<div class="method-source-code" id="M000002-source">
|
188
|
+
<pre>
|
189
|
+
<span class="ruby-comment cmt"># File lib/algorithms/search.rb, line 44</span>
|
190
|
+
44: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">kmp_search</span>(<span class="ruby-identifier">string</span>, <span class="ruby-identifier">substring</span>)
|
191
|
+
45: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">string</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">substring</span>.<span class="ruby-identifier">nil?</span>
|
192
|
+
46:
|
193
|
+
47: <span class="ruby-comment cmt"># create failure function table</span>
|
194
|
+
48: <span class="ruby-identifier">pos</span> = <span class="ruby-value">2</span>
|
195
|
+
49: <span class="ruby-identifier">cnd</span> = <span class="ruby-value">0</span>
|
196
|
+
50: <span class="ruby-identifier">failure_table</span> = [<span class="ruby-value">-1</span>, <span class="ruby-value">0</span>]
|
197
|
+
51: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">pos</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">substring</span>.<span class="ruby-identifier">length</span>
|
198
|
+
52: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">substring</span>[<span class="ruby-identifier">pos</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">substring</span>[<span class="ruby-identifier">cnd</span>]
|
199
|
+
53: <span class="ruby-identifier">failure_table</span>[<span class="ruby-identifier">pos</span>] = <span class="ruby-identifier">cnd</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
200
|
+
54: <span class="ruby-identifier">pos</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
201
|
+
55: <span class="ruby-identifier">cnd</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
202
|
+
56: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">cnd</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
203
|
+
57: <span class="ruby-identifier">cnd</span> = <span class="ruby-identifier">failure_table</span>[<span class="ruby-identifier">cnd</span>]
|
204
|
+
58: <span class="ruby-keyword kw">else</span>
|
205
|
+
59: <span class="ruby-identifier">failure_table</span>[<span class="ruby-identifier">pos</span>] = <span class="ruby-value">0</span>
|
206
|
+
60: <span class="ruby-identifier">pos</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
207
|
+
61: <span class="ruby-keyword kw">end</span>
|
208
|
+
62: <span class="ruby-keyword kw">end</span>
|
209
|
+
63:
|
210
|
+
64: <span class="ruby-identifier">m</span> = <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
|
211
|
+
65: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">m</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">i</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">string</span>.<span class="ruby-identifier">length</span>
|
212
|
+
66: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">substring</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">string</span>[<span class="ruby-identifier">m</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">i</span>]
|
213
|
+
67: <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
214
|
+
68: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">m</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">substring</span>.<span class="ruby-identifier">length</span>
|
215
|
+
69: <span class="ruby-keyword kw">else</span>
|
216
|
+
70: <span class="ruby-identifier">m</span> = <span class="ruby-identifier">m</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">failure_table</span>[<span class="ruby-identifier">i</span>]
|
217
|
+
71: <span class="ruby-identifier">i</span> = <span class="ruby-identifier">failure_table</span>[<span class="ruby-identifier">i</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
218
|
+
72: <span class="ruby-keyword kw">end</span>
|
219
|
+
73: <span class="ruby-keyword kw">end</span>
|
220
|
+
74: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
221
|
+
75: <span class="ruby-keyword kw">end</span>
|
222
|
+
</pre>
|
223
|
+
</div>
|
224
|
+
</div>
|
225
|
+
</div>
|
226
|
+
|
227
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
228
|
+
|
229
|
+
<div id="method-M000003" class="method-detail">
|
230
|
+
<a name="M000003"></a>
|
231
|
+
|
232
|
+
<div class="method-heading">
|
233
|
+
<a href="#M000003" class="method-signature">
|
234
|
+
<span class="method-name">kmp_search</span><span class="method-args">(substring)</span>
|
235
|
+
</a>
|
236
|
+
</div>
|
237
|
+
|
238
|
+
<div class="method-description">
|
239
|
+
<p>
|
240
|
+
Allows <a href="Search.html#M000002">kmp_search</a> to be called as an
|
241
|
+
instance method in classes that include the <a
|
242
|
+
href="Search.html">Search</a> module.
|
243
|
+
</p>
|
244
|
+
<pre>
|
245
|
+
class String; include Algorithms::Search; end
|
246
|
+
"ABC ABCDAB ABCDABCDABDE".kmp_search("ABCDABD") #=> 15
|
247
|
+
</pre>
|
248
|
+
<p><a class="source-toggle" href="#"
|
249
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
250
|
+
<div class="method-source-code" id="M000003-source">
|
251
|
+
<pre>
|
252
|
+
<span class="ruby-comment cmt"># File lib/algorithms/search.rb, line 81</span>
|
253
|
+
81: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">kmp_search</span>(<span class="ruby-identifier">substring</span>)
|
254
|
+
82: <span class="ruby-constant">Algorithms</span><span class="ruby-operator">::</span><span class="ruby-constant">Search</span>.<span class="ruby-identifier">kmp_search</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">substring</span>)
|
255
|
+
83: <span class="ruby-keyword kw">end</span>
|
256
|
+
</pre>
|
257
|
+
</div>
|
258
|
+
</div>
|
259
|
+
</div>
|
260
|
+
|
261
|
+
|
262
|
+
</div>
|
263
|
+
|
264
|
+
|
265
|
+
</div>
|
266
|
+
|
267
|
+
|
268
|
+
<div id="validator-badges">
|
269
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
270
|
+
</div>
|
271
|
+
|
272
|
+
</body>
|
273
|
+
</html>
|
data/rdoc/created.rid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Tue, 10 Aug 2010 14:29:25 +0200
|
@@ -0,0 +1,281 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: History.txt</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>History.txt</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>History.txt
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Tue Aug 10 13:58:23 +0200 2010</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<h3>Jan 3, 2009</h3>
|
73
|
+
<pre>
|
74
|
+
* Levenshtein distance in C
|
75
|
+
</pre>
|
76
|
+
<h3>April 3, 2009</h3>
|
77
|
+
<pre>
|
78
|
+
* Finished C refactorization of SplayTree
|
79
|
+
</pre>
|
80
|
+
<h3>March 28, 2009</h3>
|
81
|
+
<pre>
|
82
|
+
* Implemented SplayTree in C
|
83
|
+
* Made recursively_free_nodes methods static to fix a SEGFAULT
|
84
|
+
* Improved CBst
|
85
|
+
* Moved to Markdown for README
|
86
|
+
* 0.2.0 release
|
87
|
+
</pre>
|
88
|
+
<h3>January 19, 2009</h3>
|
89
|
+
<pre>
|
90
|
+
* kd-tree for points in multi-dimensional space
|
91
|
+
</pre>
|
92
|
+
<h3>November 25, 2008</h3>
|
93
|
+
<pre>
|
94
|
+
* Checked in gnufied's C BST
|
95
|
+
</pre>
|
96
|
+
<h3>November 13, 2008</h3>
|
97
|
+
<pre>
|
98
|
+
* Removed #each for Hash and Priority Queue (Feature)
|
99
|
+
</pre>
|
100
|
+
<h3>September 15, 2008</h3>
|
101
|
+
<pre>
|
102
|
+
* Added comb sort
|
103
|
+
* Benchmark work on sorting algorithms
|
104
|
+
</pre>
|
105
|
+
<h3>September 1, 2008</h3>
|
106
|
+
<pre>
|
107
|
+
* Switched to Hanna rdoc template
|
108
|
+
* RBTree#isred now private
|
109
|
+
</pre>
|
110
|
+
<h3>August 20, 2008</h3>
|
111
|
+
<pre>
|
112
|
+
* Implemented Knuth-Morris-Pratt substring algorithm
|
113
|
+
</pre>
|
114
|
+
<h3>August 15, 2008</h3>
|
115
|
+
<pre>
|
116
|
+
* Updated README to reflect progress
|
117
|
+
</pre>
|
118
|
+
<h3>August 10, 2008</h3>
|
119
|
+
<pre>
|
120
|
+
* Implemented mergesort, insertion_sort, shell_sort, quicksort
|
121
|
+
</pre>
|
122
|
+
<h3>August 8, 2008</h3>
|
123
|
+
<pre>
|
124
|
+
* Implemented bubble_sort, selection_sort, heapsort
|
125
|
+
</pre>
|
126
|
+
<h3>August 5, 2008</h3>
|
127
|
+
<pre>
|
128
|
+
* Started Algorithms portion
|
129
|
+
* Implemented Search#binary_search
|
130
|
+
</pre>
|
131
|
+
<h3>July 20, 2008</h3>
|
132
|
+
<pre>
|
133
|
+
* Iterate over trees iteratively instead of recursively
|
134
|
+
* Implemented Deque in C
|
135
|
+
</pre>
|
136
|
+
<h3>July 15, 2008</h3>
|
137
|
+
<pre>
|
138
|
+
* Refactored namespaces, thank you Austin Ziegler!
|
139
|
+
</pre>
|
140
|
+
<h3>July 14, 2008</h3>
|
141
|
+
<pre>
|
142
|
+
* Use alias_method instead of alias
|
143
|
+
* Found and fixed RBTree#delete bug (finally!)
|
144
|
+
* Refactored Trie, SuffixArray, SplayTreeMap
|
145
|
+
</pre>
|
146
|
+
<h3>July 13, 2008</h3>
|
147
|
+
<pre>
|
148
|
+
* Refactored Deque
|
149
|
+
* Implemented Deque#reverse_each (like Array's)
|
150
|
+
</pre>
|
151
|
+
<h3>July 12, 2008</h3>
|
152
|
+
<pre>
|
153
|
+
* Reformatted some specs to be more idiomatic (Thank you Federico Builes)
|
154
|
+
</pre>
|
155
|
+
<h3>July 10, 2008</h3>
|
156
|
+
<pre>
|
157
|
+
* Added algorithm complexity information for all Containers
|
158
|
+
* Implemented Trie for string representation
|
159
|
+
* Implmented SuffixArray for fast substring search
|
160
|
+
* Fixed memory leak in CRBTree
|
161
|
+
* Updated Manifest and algorithms.rb to match progress
|
162
|
+
</pre>
|
163
|
+
<h3>July 9, 2008</h3>
|
164
|
+
<pre>
|
165
|
+
* Implemented Deque
|
166
|
+
* Stack and Queue now use Deque
|
167
|
+
* Fixed issues with CRBTree's #empty? and delete methods
|
168
|
+
</pre>
|
169
|
+
<h3>July 8, 2008</h3>
|
170
|
+
<pre>
|
171
|
+
* Can now iterate over a heap
|
172
|
+
* Renamed #contains_key -> has_key? since it's more idiomatic
|
173
|
+
* Implented #change_key and #delete for Heap
|
174
|
+
* Priority Queue is now implemented with the new Fibonacci Heap
|
175
|
+
* Removed old Priority Queue code as a result
|
176
|
+
* Heap: fixed #delete bug not checking if item exists, #has_key? bug
|
177
|
+
for not returning boolean
|
178
|
+
* Heap: value field is now optional and defaults to the key if not specified
|
179
|
+
* More refactoring of RBTreeMap (both Ruby and C)
|
180
|
+
</pre>
|
181
|
+
<h3>July 7, 2008</h3>
|
182
|
+
<pre>
|
183
|
+
* Heap is now implemented with a Fibonacci Heap, not a binomial heap
|
184
|
+
</pre>
|
185
|
+
<h3>July 4, 2008</h3>
|
186
|
+
<pre>
|
187
|
+
* Implemented SplayTreeMap
|
188
|
+
* Heap now uses kind_of? to check for other heaps when doing #merge
|
189
|
+
* Renamed some Heap methods for consistency with the rest of the library
|
190
|
+
* RBTreeMap#contains? -> contains_key?
|
191
|
+
* Refactored RBTreeMap to be more object-oriented
|
192
|
+
* More documentation for RBTreeMap
|
193
|
+
</pre>
|
194
|
+
<h3>July 3, 2008</h3>
|
195
|
+
<pre>
|
196
|
+
* Added documentation for Stack and Queue
|
197
|
+
</pre>
|
198
|
+
<h3>June 24, 2008</h3>
|
199
|
+
<pre>
|
200
|
+
* Imported Brian Amberg's priority queue implementation
|
201
|
+
* Now uses Echoe to build gem
|
202
|
+
* Gem builds for the first time
|
203
|
+
</pre>
|
204
|
+
<h3>June 18, 2008</h3>
|
205
|
+
<pre>
|
206
|
+
* Can now enumerate over RBTreeMap
|
207
|
+
</pre>
|
208
|
+
<h3>June 17, 2008</h3>
|
209
|
+
<pre>
|
210
|
+
* RBTreemap#delete now returns deleted value
|
211
|
+
* Added delete method to C implementation
|
212
|
+
</pre>
|
213
|
+
<h3>June 16, 2008</h3>
|
214
|
+
<pre>
|
215
|
+
* Implemented delete methods for RBTreeMap
|
216
|
+
</pre>
|
217
|
+
<h3>June 14, 2008</h3>
|
218
|
+
<pre>
|
219
|
+
* Renamed the data structures module to "Containers"
|
220
|
+
* Removed dependence on stdbool.h
|
221
|
+
* Renamed RBTree to RBTreeMap
|
222
|
+
</pre>
|
223
|
+
<h3>June 13, 2008</h3>
|
224
|
+
<pre>
|
225
|
+
* Implemented Sedgewick's Left Leaning Red Black Tree in C!
|
226
|
+
</pre>
|
227
|
+
<h3>June 12, 2008</h3>
|
228
|
+
<pre>
|
229
|
+
* Implemented Sedgewick's Left Leaning Red Black Tree
|
230
|
+
</pre>
|
231
|
+
<h3>June 10, 2008</h3>
|
232
|
+
<pre>
|
233
|
+
* Implemented merge! for other heaps and heap initialization from an array
|
234
|
+
* Implemented Queue
|
235
|
+
</pre>
|
236
|
+
<h3>June 9, 2008</h3>
|
237
|
+
<pre>
|
238
|
+
* Finished binomial heap implementation
|
239
|
+
</pre>
|
240
|
+
<h3>June 8, 2008</h3>
|
241
|
+
<pre>
|
242
|
+
* Added Stack
|
243
|
+
* Working on heap
|
244
|
+
</pre>
|
245
|
+
<h3>April 20</h3>
|
246
|
+
<pre>
|
247
|
+
* Accepted to Google Summer of Code!
|
248
|
+
</pre>
|
249
|
+
|
250
|
+
</div>
|
251
|
+
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
|
256
|
+
</div>
|
257
|
+
|
258
|
+
|
259
|
+
<!-- if includes -->
|
260
|
+
|
261
|
+
<div id="section">
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
<!-- if method_list -->
|
271
|
+
|
272
|
+
|
273
|
+
</div>
|
274
|
+
|
275
|
+
|
276
|
+
<div id="validator-badges">
|
277
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
278
|
+
</div>
|
279
|
+
|
280
|
+
</body>
|
281
|
+
</html>
|