ds 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. data/.gitignore +2 -0
  2. data/README.rdoc +490 -0
  3. data/Rakefile +1 -1
  4. data/lib/ds.rb +17 -19
  5. data/lib/ds/ext/array_x.rb +35 -0
  6. data/lib/ds/graphs/graph.rb +36 -32
  7. data/lib/ds/graphs/graph_as_matrix.rb +22 -23
  8. data/lib/ds/graphs/graph_as_tri_matrix.rb +1 -2
  9. data/lib/ds/lists/list.rb +18 -21
  10. data/lib/ds/matrixes/array_2d.rb +4 -0
  11. data/lib/ds/pair.rb +14 -0
  12. data/lib/ds/queues/priority_queue.rb +36 -0
  13. data/lib/ds/queues/queue.rb +1 -1
  14. data/lib/ds/sets/ordered_set.rb +32 -0
  15. data/lib/ds/trees/binary_heap.rb +45 -14
  16. data/lib/ds/trees/binary_search_tree.rb +3 -1
  17. data/lib/ds/trees/binary_tree.rb +11 -5
  18. data/lib/ds/trees/complete_binary_tree.rb +24 -16
  19. data/lib/ds/trees/tree.rb +3 -3
  20. data/lib/ds/trees/tree_walker.rb +7 -6
  21. data/lib/ds/trees/trie.rb +14 -20
  22. data/lib/ds/version.rb +1 -1
  23. data/test/help.rb +12 -3
  24. data/test/test_array2d.rb +14 -4
  25. data/test/test_array_x.rb +27 -7
  26. data/test/test_binary_heap.rb +19 -1
  27. data/test/test_binary_search_tree.rb +8 -1
  28. data/test/test_binary_tree.rb +7 -1
  29. data/test/test_complete_binary_tree.rb +34 -6
  30. data/test/test_digraph.rb +1 -1
  31. data/test/test_graph.rb +10 -1
  32. data/test/test_list.rb +59 -2
  33. data/test/test_ordered_set.rb +28 -0
  34. data/test/test_pair.rb +26 -0
  35. data/test/test_priority_queue.rb +134 -0
  36. data/test/test_queue.rb +3 -3
  37. data/test/test_stack.rb +0 -2
  38. data/test/test_tree.rb +32 -9
  39. data/test/test_tree_walker.rb +22 -0
  40. data/test/test_trie.rb +20 -2
  41. metadata +13 -81
  42. data/doc/Array.html +0 -264
  43. data/doc/DS.html +0 -292
  44. data/doc/DS/Array2D.html +0 -345
  45. data/doc/DS/BinaryHeap.html +0 -493
  46. data/doc/DS/BinarySearchTree.html +0 -313
  47. data/doc/DS/BinaryTree.html +0 -433
  48. data/doc/DS/CompleteBinaryTree.html +0 -550
  49. data/doc/DS/CyclicList.html +0 -234
  50. data/doc/DS/Digraph.html +0 -299
  51. data/doc/DS/Edge.html +0 -283
  52. data/doc/DS/ExpandableArray.html +0 -316
  53. data/doc/DS/Graph.html +0 -739
  54. data/doc/DS/GraphAsList.html +0 -361
  55. data/doc/DS/GraphAsMatrix.html +0 -633
  56. data/doc/DS/GraphAsTriMatrix.html +0 -274
  57. data/doc/DS/List.html +0 -1263
  58. data/doc/DS/ListElement.html +0 -344
  59. data/doc/DS/Queue.html +0 -517
  60. data/doc/DS/Ring.html +0 -323
  61. data/doc/DS/Stack.html +0 -407
  62. data/doc/DS/Tree.html +0 -770
  63. data/doc/DS/TreeWalker.html +0 -561
  64. data/doc/DS/TriMatrix.html +0 -338
  65. data/doc/created.rid +0 -25
  66. data/doc/ds/graphs/digraph_rb.html +0 -52
  67. data/doc/ds/graphs/edge_rb.html +0 -52
  68. data/doc/ds/graphs/graph_as_list_rb.html +0 -52
  69. data/doc/ds/graphs/graph_as_matrix_rb.html +0 -52
  70. data/doc/ds/graphs/graph_as_tri_matrix_rb.html +0 -52
  71. data/doc/ds/graphs/graph_rb.html +0 -52
  72. data/doc/ds/lists/cyclic_list_rb.html +0 -52
  73. data/doc/ds/lists/list_element_rb.html +0 -52
  74. data/doc/ds/lists/list_rb.html +0 -52
  75. data/doc/ds/lists/ring_rb.html +0 -52
  76. data/doc/ds/matrixes/array_2d_rb.html +0 -52
  77. data/doc/ds/matrixes/expandable_array_rb.html +0 -52
  78. data/doc/ds/matrixes/tri_matrix_rb.html +0 -52
  79. data/doc/ds/queues/queue_rb.html +0 -52
  80. data/doc/ds/stacks/stack_rb.html +0 -52
  81. data/doc/ds/trees/binary_heap_rb.html +0 -52
  82. data/doc/ds/trees/binary_search_tree_rb.html +0 -52
  83. data/doc/ds/trees/binary_tree_rb.html +0 -52
  84. data/doc/ds/trees/complete_binary_tree_rb.html +0 -52
  85. data/doc/ds/trees/tree_rb.html +0 -52
  86. data/doc/ds/trees/tree_walker_rb.html +0 -52
  87. data/doc/ds/version_rb.html +0 -52
  88. data/doc/ds_rb.html +0 -98
  89. data/doc/ext/ext_rb.html +0 -52
  90. data/doc/images/brick.png +0 -0
  91. data/doc/images/brick_link.png +0 -0
  92. data/doc/images/bug.png +0 -0
  93. data/doc/images/bullet_black.png +0 -0
  94. data/doc/images/bullet_toggle_minus.png +0 -0
  95. data/doc/images/bullet_toggle_plus.png +0 -0
  96. data/doc/images/date.png +0 -0
  97. data/doc/images/find.png +0 -0
  98. data/doc/images/loadingAnimation.gif +0 -0
  99. data/doc/images/macFFBgHack.png +0 -0
  100. data/doc/images/package.png +0 -0
  101. data/doc/images/page_green.png +0 -0
  102. data/doc/images/page_white_text.png +0 -0
  103. data/doc/images/page_white_width.png +0 -0
  104. data/doc/images/plugin.png +0 -0
  105. data/doc/images/ruby.png +0 -0
  106. data/doc/images/tag_green.png +0 -0
  107. data/doc/images/wrench.png +0 -0
  108. data/doc/images/wrench_orange.png +0 -0
  109. data/doc/images/zoom.png +0 -0
  110. data/doc/index.html +0 -375
  111. data/doc/js/darkfish.js +0 -116
  112. data/doc/js/jquery.js +0 -32
  113. data/doc/js/quicksearch.js +0 -114
  114. data/doc/js/thickbox-compressed.js +0 -10
  115. data/doc/rdoc.css +0 -763
  116. data/lib/ds/ext/ext.rb +0 -36
  117. data/lib/ds/graphs/graph_as_list.rb +0 -48
@@ -1,292 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
- <head>
6
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
-
8
- <title>Module: DS</title>
9
-
10
- <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
11
-
12
- <script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
13
- <script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
14
- <script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
15
- <script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
16
-
17
- </head>
18
- <body id="top" class="module">
19
-
20
- <div id="metadata">
21
- <div id="home-metadata">
22
- <div id="home-section" class="section">
23
- <h3 class="section-header">
24
- <a href="./index.html">Home</a>
25
- <a href="./index.html#classes">Classes</a>
26
- <a href="./index.html#methods">Methods</a>
27
- </h3>
28
- </div>
29
- </div>
30
-
31
- <div id="file-metadata">
32
- <div id="file-list-section" class="section">
33
- <h3 class="section-header">In Files</h3>
34
- <div class="section-body">
35
- <ul>
36
-
37
- <li><a href="./ds/matrixes/array_2d_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
- class="thickbox" title="ds/matrixes/array_2d.rb">ds/matrixes/array_2d.rb</a></li>
39
-
40
- <li><a href="./ds/matrixes/tri_matrix_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
41
- class="thickbox" title="ds/matrixes/tri_matrix.rb">ds/matrixes/tri_matrix.rb</a></li>
42
-
43
- <li><a href="./ds/matrixes/expandable_array_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
44
- class="thickbox" title="ds/matrixes/expandable_array.rb">ds/matrixes/expandable_array.rb</a></li>
45
-
46
- <li><a href="./ds/trees/tree_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
47
- class="thickbox" title="ds/trees/tree.rb">ds/trees/tree.rb</a></li>
48
-
49
- <li><a href="./ds/trees/binary_search_tree_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
50
- class="thickbox" title="ds/trees/binary_search_tree.rb">ds/trees/binary_search_tree.rb</a></li>
51
-
52
- <li><a href="./ds/trees/binary_heap_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
53
- class="thickbox" title="ds/trees/binary_heap.rb">ds/trees/binary_heap.rb</a></li>
54
-
55
- <li><a href="./ds/trees/complete_binary_tree_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
56
- class="thickbox" title="ds/trees/complete_binary_tree.rb">ds/trees/complete_binary_tree.rb</a></li>
57
-
58
- <li><a href="./ds/trees/binary_tree_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
59
- class="thickbox" title="ds/trees/binary_tree.rb">ds/trees/binary_tree.rb</a></li>
60
-
61
- <li><a href="./ds/trees/tree_walker_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
62
- class="thickbox" title="ds/trees/tree_walker.rb">ds/trees/tree_walker.rb</a></li>
63
-
64
- <li><a href="./ds/stacks/stack_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
65
- class="thickbox" title="ds/stacks/stack.rb">ds/stacks/stack.rb</a></li>
66
-
67
- <li><a href="./ds/queues/queue_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
68
- class="thickbox" title="ds/queues/queue.rb">ds/queues/queue.rb</a></li>
69
-
70
- <li><a href="./ds/version_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
71
- class="thickbox" title="ds/version.rb">ds/version.rb</a></li>
72
-
73
- <li><a href="./ds/lists/list_element_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
74
- class="thickbox" title="ds/lists/list_element.rb">ds/lists/list_element.rb</a></li>
75
-
76
- <li><a href="./ds/lists/ring_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
77
- class="thickbox" title="ds/lists/ring.rb">ds/lists/ring.rb</a></li>
78
-
79
- <li><a href="./ds/lists/cyclic_list_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
80
- class="thickbox" title="ds/lists/cyclic_list.rb">ds/lists/cyclic_list.rb</a></li>
81
-
82
- <li><a href="./ds/lists/list_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
83
- class="thickbox" title="ds/lists/list.rb">ds/lists/list.rb</a></li>
84
-
85
- <li><a href="./ds/graphs/graph_as_matrix_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
86
- class="thickbox" title="ds/graphs/graph_as_matrix.rb">ds/graphs/graph_as_matrix.rb</a></li>
87
-
88
- <li><a href="./ds/graphs/graph_as_list_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
89
- class="thickbox" title="ds/graphs/graph_as_list.rb">ds/graphs/graph_as_list.rb</a></li>
90
-
91
- <li><a href="./ds/graphs/graph_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
92
- class="thickbox" title="ds/graphs/graph.rb">ds/graphs/graph.rb</a></li>
93
-
94
- <li><a href="./ds/graphs/digraph_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
95
- class="thickbox" title="ds/graphs/digraph.rb">ds/graphs/digraph.rb</a></li>
96
-
97
- <li><a href="./ds/graphs/edge_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
98
- class="thickbox" title="ds/graphs/edge.rb">ds/graphs/edge.rb</a></li>
99
-
100
- <li><a href="./ds/graphs/graph_as_tri_matrix_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
101
- class="thickbox" title="ds/graphs/graph_as_tri_matrix.rb">ds/graphs/graph_as_tri_matrix.rb</a></li>
102
-
103
- </ul>
104
- </div>
105
- </div>
106
-
107
-
108
- </div>
109
-
110
- <div id="class-metadata">
111
-
112
-
113
-
114
-
115
-
116
- <!-- Namespace Contents -->
117
- <div id="namespace-list-section" class="section">
118
- <h3 class="section-header">Namespace</h3>
119
- <ul class="link-list">
120
-
121
- <li><span class="type">CLASS</span> <a href="DS/Array2D.html">DS::Array2D</a></li>
122
-
123
- <li><span class="type">CLASS</span> <a href="DS/BinaryHeap.html">DS::BinaryHeap</a></li>
124
-
125
- <li><span class="type">CLASS</span> <a href="DS/BinarySearchTree.html">DS::BinarySearchTree</a></li>
126
-
127
- <li><span class="type">CLASS</span> <a href="DS/BinaryTree.html">DS::BinaryTree</a></li>
128
-
129
- <li><span class="type">CLASS</span> <a href="DS/CompleteBinaryTree.html">DS::CompleteBinaryTree</a></li>
130
-
131
- <li><span class="type">CLASS</span> <a href="DS/CyclicList.html">DS::CyclicList</a></li>
132
-
133
- <li><span class="type">CLASS</span> <a href="DS/Digraph.html">DS::Digraph</a></li>
134
-
135
- <li><span class="type">CLASS</span> <a href="DS/Edge.html">DS::Edge</a></li>
136
-
137
- <li><span class="type">CLASS</span> <a href="DS/ExpandableArray.html">DS::ExpandableArray</a></li>
138
-
139
- <li><span class="type">CLASS</span> <a href="DS/Graph.html">DS::Graph</a></li>
140
-
141
- <li><span class="type">CLASS</span> <a href="DS/GraphAsList.html">DS::GraphAsList</a></li>
142
-
143
- <li><span class="type">CLASS</span> <a href="DS/GraphAsMatrix.html">DS::GraphAsMatrix</a></li>
144
-
145
- <li><span class="type">CLASS</span> <a href="DS/GraphAsTriMatrix.html">DS::GraphAsTriMatrix</a></li>
146
-
147
- <li><span class="type">CLASS</span> <a href="DS/List.html">DS::List</a></li>
148
-
149
- <li><span class="type">CLASS</span> <a href="DS/ListElement.html">DS::ListElement</a></li>
150
-
151
- <li><span class="type">CLASS</span> <a href="DS/Queue.html">DS::Queue</a></li>
152
-
153
- <li><span class="type">CLASS</span> <a href="DS/Ring.html">DS::Ring</a></li>
154
-
155
- <li><span class="type">CLASS</span> <a href="DS/Stack.html">DS::Stack</a></li>
156
-
157
- <li><span class="type">CLASS</span> <a href="DS/Tree.html">DS::Tree</a></li>
158
-
159
- <li><span class="type">CLASS</span> <a href="DS/TreeWalker.html">DS::TreeWalker</a></li>
160
-
161
- <li><span class="type">CLASS</span> <a href="DS/TriMatrix.html">DS::TriMatrix</a></li>
162
-
163
- </ul>
164
- </div>
165
-
166
-
167
-
168
-
169
-
170
- </div>
171
-
172
- <div id="project-metadata">
173
-
174
-
175
-
176
- <div id="classindex-section" class="section project-section">
177
- <h3 class="section-header">Class/Module Index
178
- <span class="search-toggle"><img src="./images/find.png"
179
- height="16" width="16" alt="[+]"
180
- title="show/hide quicksearch" /></span></h3>
181
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
182
- <fieldset>
183
- <legend>Quicksearch</legend>
184
- <input type="text" name="quicksearch" value=""
185
- class="quicksearch-field" />
186
- </fieldset>
187
- </form>
188
-
189
- <ul class="link-list">
190
-
191
- <li><a href="./DS.html">DS</a></li>
192
-
193
- <li><a href="./DS/Array2D.html">DS::Array2D</a></li>
194
-
195
- <li><a href="./DS/BinaryHeap.html">DS::BinaryHeap</a></li>
196
-
197
- <li><a href="./DS/BinarySearchTree.html">DS::BinarySearchTree</a></li>
198
-
199
- <li><a href="./DS/BinaryTree.html">DS::BinaryTree</a></li>
200
-
201
- <li><a href="./DS/CompleteBinaryTree.html">DS::CompleteBinaryTree</a></li>
202
-
203
- <li><a href="./DS/CyclicList.html">DS::CyclicList</a></li>
204
-
205
- <li><a href="./DS/Digraph.html">DS::Digraph</a></li>
206
-
207
- <li><a href="./DS/Edge.html">DS::Edge</a></li>
208
-
209
- <li><a href="./DS/ExpandableArray.html">DS::ExpandableArray</a></li>
210
-
211
- <li><a href="./DS/Graph.html">DS::Graph</a></li>
212
-
213
- <li><a href="./DS/GraphAsList.html">DS::GraphAsList</a></li>
214
-
215
- <li><a href="./DS/GraphAsMatrix.html">DS::GraphAsMatrix</a></li>
216
-
217
- <li><a href="./DS/GraphAsTriMatrix.html">DS::GraphAsTriMatrix</a></li>
218
-
219
- <li><a href="./DS/List.html">DS::List</a></li>
220
-
221
- <li><a href="./DS/ListElement.html">DS::ListElement</a></li>
222
-
223
- <li><a href="./DS/Queue.html">DS::Queue</a></li>
224
-
225
- <li><a href="./DS/Ring.html">DS::Ring</a></li>
226
-
227
- <li><a href="./DS/Stack.html">DS::Stack</a></li>
228
-
229
- <li><a href="./DS/Tree.html">DS::Tree</a></li>
230
-
231
- <li><a href="./DS/TreeWalker.html">DS::TreeWalker</a></li>
232
-
233
- <li><a href="./DS/TriMatrix.html">DS::TriMatrix</a></li>
234
-
235
- <li><a href="./Array.html">Array</a></li>
236
-
237
- </ul>
238
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
239
- </div>
240
-
241
-
242
- </div>
243
- </div>
244
-
245
- <div id="documentation">
246
- <h1 class="module">DS</h1>
247
-
248
- <div id="description" class="description">
249
-
250
- </div><!-- description -->
251
-
252
-
253
-
254
-
255
- <div id="5Buntitled-5D" class="documentation-section">
256
-
257
-
258
-
259
-
260
-
261
- <!-- Constants -->
262
- <div id="constants-list" class="section">
263
- <h3 class="section-header">Constants</h3>
264
- <dl>
265
-
266
- <dt><a name="VERSION">VERSION</a></dt>
267
-
268
- <dd class="description"></dd>
269
-
270
-
271
- </dl>
272
- </div>
273
-
274
-
275
-
276
-
277
- <!-- Methods -->
278
-
279
- </div><!-- 5Buntitled-5D -->
280
-
281
-
282
- </div><!-- documentation -->
283
-
284
- <div id="validator-badges">
285
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
286
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
287
- Rdoc Generator</a> 2</small>.</p>
288
- </div>
289
-
290
- </body>
291
- </html>
292
-
@@ -1,345 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
- <head>
6
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
-
8
- <title>Class: DS::Array2D</title>
9
-
10
- <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
-
12
- <script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
13
- <script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
14
- <script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
15
- <script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
16
-
17
- </head>
18
- <body id="top" class="class">
19
-
20
- <div id="metadata">
21
- <div id="home-metadata">
22
- <div id="home-section" class="section">
23
- <h3 class="section-header">
24
- <a href="../index.html">Home</a>
25
- <a href="../index.html#classes">Classes</a>
26
- <a href="../index.html#methods">Methods</a>
27
- </h3>
28
- </div>
29
- </div>
30
-
31
- <div id="file-metadata">
32
- <div id="file-list-section" class="section">
33
- <h3 class="section-header">In Files</h3>
34
- <div class="section-body">
35
- <ul>
36
-
37
- <li><a href="../ds/matrixes/array_2d_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
- class="thickbox" title="ds/matrixes/array_2d.rb">ds/matrixes/array_2d.rb</a></li>
39
-
40
- </ul>
41
- </div>
42
- </div>
43
-
44
-
45
- </div>
46
-
47
- <div id="class-metadata">
48
-
49
- <!-- Parent Class -->
50
- <div id="parent-class-section" class="section">
51
- <h3 class="section-header">Parent</h3>
52
-
53
- <p class="link">Object</p>
54
-
55
- </div>
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
- <!-- Method Quickref -->
64
- <div id="method-list-section" class="section">
65
- <h3 class="section-header">Methods</h3>
66
- <ul class="link-list">
67
-
68
- <li><a href="#method-c-new">::new</a></li>
69
-
70
- <li><a href="#method-i-5B-5D">#[]</a></li>
71
-
72
- <li><a href="#method-i-5B-5D-3D">#[]=</a></li>
73
-
74
- <li><a href="#method-i-to_a">#to_a</a></li>
75
-
76
- </ul>
77
- </div>
78
-
79
-
80
-
81
- </div>
82
-
83
- <div id="project-metadata">
84
-
85
-
86
-
87
- <div id="classindex-section" class="section project-section">
88
- <h3 class="section-header">Class/Module Index
89
- <span class="search-toggle"><img src="../images/find.png"
90
- height="16" width="16" alt="[+]"
91
- title="show/hide quicksearch" /></span></h3>
92
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
93
- <fieldset>
94
- <legend>Quicksearch</legend>
95
- <input type="text" name="quicksearch" value=""
96
- class="quicksearch-field" />
97
- </fieldset>
98
- </form>
99
-
100
- <ul class="link-list">
101
-
102
- <li><a href="../DS.html">DS</a></li>
103
-
104
- <li><a href="../DS/Array2D.html">DS::Array2D</a></li>
105
-
106
- <li><a href="../DS/BinaryHeap.html">DS::BinaryHeap</a></li>
107
-
108
- <li><a href="../DS/BinarySearchTree.html">DS::BinarySearchTree</a></li>
109
-
110
- <li><a href="../DS/BinaryTree.html">DS::BinaryTree</a></li>
111
-
112
- <li><a href="../DS/CompleteBinaryTree.html">DS::CompleteBinaryTree</a></li>
113
-
114
- <li><a href="../DS/CyclicList.html">DS::CyclicList</a></li>
115
-
116
- <li><a href="../DS/Digraph.html">DS::Digraph</a></li>
117
-
118
- <li><a href="../DS/Edge.html">DS::Edge</a></li>
119
-
120
- <li><a href="../DS/ExpandableArray.html">DS::ExpandableArray</a></li>
121
-
122
- <li><a href="../DS/Graph.html">DS::Graph</a></li>
123
-
124
- <li><a href="../DS/GraphAsList.html">DS::GraphAsList</a></li>
125
-
126
- <li><a href="../DS/GraphAsMatrix.html">DS::GraphAsMatrix</a></li>
127
-
128
- <li><a href="../DS/GraphAsTriMatrix.html">DS::GraphAsTriMatrix</a></li>
129
-
130
- <li><a href="../DS/List.html">DS::List</a></li>
131
-
132
- <li><a href="../DS/ListElement.html">DS::ListElement</a></li>
133
-
134
- <li><a href="../DS/Queue.html">DS::Queue</a></li>
135
-
136
- <li><a href="../DS/Ring.html">DS::Ring</a></li>
137
-
138
- <li><a href="../DS/Stack.html">DS::Stack</a></li>
139
-
140
- <li><a href="../DS/Tree.html">DS::Tree</a></li>
141
-
142
- <li><a href="../DS/TreeWalker.html">DS::TreeWalker</a></li>
143
-
144
- <li><a href="../DS/TriMatrix.html">DS::TriMatrix</a></li>
145
-
146
- <li><a href="../Array.html">Array</a></li>
147
-
148
- </ul>
149
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
150
- </div>
151
-
152
-
153
- </div>
154
- </div>
155
-
156
- <div id="documentation">
157
- <h1 class="class">DS::Array2D</h1>
158
-
159
- <div id="description" class="description">
160
-
161
- <p>Implements two dimensional array.</p>
162
-
163
- </div><!-- description -->
164
-
165
-
166
-
167
-
168
- <div id="5Buntitled-5D" class="documentation-section">
169
-
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
- <!-- Methods -->
178
-
179
- <div id="public-class-method-details" class="method-section section">
180
- <h3 class="section-header">Public Class Methods</h3>
181
-
182
-
183
- <div id="new-method" class="method-detail ">
184
- <a name="method-c-new"></a>
185
-
186
-
187
- <div class="method-heading">
188
- <span class="method-name">new</span><span
189
- class="method-args">(size=1,init=0)</span>
190
- <span class="method-click-advice">click to toggle source</span>
191
- </div>
192
-
193
-
194
- <div class="method-description">
195
-
196
- <p>Creates new two dimensional array. Init is the default value of the array.</p>
197
-
198
-
199
-
200
- <div class="method-source-code" id="new-source">
201
- <pre>
202
- <span class="ruby-comment"># File ds/matrixes/array_2d.rb, line 8</span>
203
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">size</span>=<span class="ruby-value">1</span>,<span class="ruby-identifier">init</span>=<span class="ruby-value">0</span>)
204
- <span class="ruby-ivar">@init</span> = <span class="ruby-identifier">init</span>
205
- <span class="ruby-ivar">@store</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">size</span>){<span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">size</span>){<span class="ruby-identifier">init</span>}}
206
- <span class="ruby-keyword">end</span></pre>
207
- </div><!-- new-source -->
208
-
209
- </div>
210
-
211
-
212
-
213
-
214
- </div><!-- new-method -->
215
-
216
-
217
- </div><!-- public-class-method-details -->
218
-
219
- <div id="public-instance-method-details" class="method-section section">
220
- <h3 class="section-header">Public Instance Methods</h3>
221
-
222
-
223
- <div id="5B-5D-method" class="method-detail ">
224
- <a name="method-i-5B-5D"></a>
225
-
226
-
227
- <div class="method-heading">
228
- <span class="method-name">[]</span><span
229
- class="method-args">(x,y)</span>
230
- <span class="method-click-advice">click to toggle source</span>
231
- </div>
232
-
233
-
234
- <div class="method-description">
235
-
236
-
237
-
238
-
239
-
240
- <div class="method-source-code" id="5B-5D-source">
241
- <pre>
242
- <span class="ruby-comment"># File ds/matrixes/array_2d.rb, line 14</span>
243
- <span class="ruby-keyword">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>)
244
- <span class="ruby-keyword">if</span> <span class="ruby-ivar">@store</span>[<span class="ruby-identifier">x</span>].<span class="ruby-identifier">nil?</span>
245
- <span class="ruby-ivar">@store</span>[<span class="ruby-identifier">x</span>] = []
246
- <span class="ruby-ivar">@init</span>
247
- <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@store</span>[<span class="ruby-identifier">x</span>][<span class="ruby-identifier">y</span>].<span class="ruby-identifier">nil?</span>
248
- <span class="ruby-ivar">@init</span>
249
- <span class="ruby-keyword">else</span>
250
- <span class="ruby-ivar">@store</span>[<span class="ruby-identifier">x</span>][<span class="ruby-identifier">y</span>]
251
- <span class="ruby-keyword">end</span>
252
- <span class="ruby-keyword">end</span></pre>
253
- </div><!-- 5B-5D-source -->
254
-
255
- </div>
256
-
257
-
258
-
259
-
260
- </div><!-- 5B-5D-method -->
261
-
262
-
263
- <div id="5B-5D-3D-method" class="method-detail ">
264
- <a name="method-i-5B-5D-3D"></a>
265
-
266
-
267
- <div class="method-heading">
268
- <span class="method-name">[]=</span><span
269
- class="method-args">(x,y,v)</span>
270
- <span class="method-click-advice">click to toggle source</span>
271
- </div>
272
-
273
-
274
- <div class="method-description">
275
-
276
-
277
-
278
-
279
-
280
- <div class="method-source-code" id="5B-5D-3D-source">
281
- <pre>
282
- <span class="ruby-comment"># File ds/matrixes/array_2d.rb, line 25</span>
283
- <span class="ruby-keyword">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span>,<span class="ruby-identifier">v</span>)
284
- <span class="ruby-ivar">@store</span>[<span class="ruby-identifier">x</span>] = [] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@store</span>[<span class="ruby-identifier">x</span>].<span class="ruby-identifier">nil?</span>
285
- <span class="ruby-ivar">@store</span>[<span class="ruby-identifier">x</span>][<span class="ruby-identifier">y</span>] = <span class="ruby-identifier">v</span>
286
- <span class="ruby-keyword">end</span></pre>
287
- </div><!-- 5B-5D-3D-source -->
288
-
289
- </div>
290
-
291
-
292
-
293
-
294
- </div><!-- 5B-5D-3D-method -->
295
-
296
-
297
- <div id="to_a-method" class="method-detail ">
298
- <a name="method-i-to_a"></a>
299
-
300
-
301
- <div class="method-heading">
302
- <span class="method-name">to_a</span><span
303
- class="method-args">()</span>
304
- <span class="method-click-advice">click to toggle source</span>
305
- </div>
306
-
307
-
308
- <div class="method-description">
309
-
310
-
311
-
312
-
313
-
314
- <div class="method-source-code" id="to_a-source">
315
- <pre>
316
- <span class="ruby-comment"># File ds/matrixes/array_2d.rb, line 30</span>
317
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_a</span>
318
- <span class="ruby-ivar">@store</span>.<span class="ruby-identifier">flatten</span>
319
- <span class="ruby-keyword">end</span></pre>
320
- </div><!-- to_a-source -->
321
-
322
- </div>
323
-
324
-
325
-
326
-
327
- </div><!-- to_a-method -->
328
-
329
-
330
- </div><!-- public-instance-method-details -->
331
-
332
- </div><!-- 5Buntitled-5D -->
333
-
334
-
335
- </div><!-- documentation -->
336
-
337
- <div id="validator-badges">
338
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
339
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
340
- Rdoc Generator</a> 2</small>.</p>
341
- </div>
342
-
343
- </body>
344
- </html>
345
-