ds 0.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.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +13 -0
- data/doc/Array.html +264 -0
- data/doc/DS.html +292 -0
- data/doc/DS/Array2D.html +345 -0
- data/doc/DS/BinaryHeap.html +493 -0
- data/doc/DS/BinarySearchTree.html +313 -0
- data/doc/DS/BinaryTree.html +433 -0
- data/doc/DS/CompleteBinaryTree.html +550 -0
- data/doc/DS/CyclicList.html +234 -0
- data/doc/DS/Digraph.html +299 -0
- data/doc/DS/Edge.html +283 -0
- data/doc/DS/ExpandableArray.html +316 -0
- data/doc/DS/Graph.html +739 -0
- data/doc/DS/GraphAsList.html +361 -0
- data/doc/DS/GraphAsMatrix.html +633 -0
- data/doc/DS/GraphAsTriMatrix.html +274 -0
- data/doc/DS/List.html +1263 -0
- data/doc/DS/ListElement.html +344 -0
- data/doc/DS/Queue.html +517 -0
- data/doc/DS/Ring.html +323 -0
- data/doc/DS/Stack.html +407 -0
- data/doc/DS/Tree.html +770 -0
- data/doc/DS/TreeWalker.html +561 -0
- data/doc/DS/TriMatrix.html +338 -0
- data/doc/created.rid +25 -0
- data/doc/ds/graphs/digraph_rb.html +52 -0
- data/doc/ds/graphs/edge_rb.html +52 -0
- data/doc/ds/graphs/graph_as_list_rb.html +52 -0
- data/doc/ds/graphs/graph_as_matrix_rb.html +52 -0
- data/doc/ds/graphs/graph_as_tri_matrix_rb.html +52 -0
- data/doc/ds/graphs/graph_rb.html +52 -0
- data/doc/ds/lists/cyclic_list_rb.html +52 -0
- data/doc/ds/lists/list_element_rb.html +52 -0
- data/doc/ds/lists/list_rb.html +52 -0
- data/doc/ds/lists/ring_rb.html +52 -0
- data/doc/ds/matrixes/array_2d_rb.html +52 -0
- data/doc/ds/matrixes/expandable_array_rb.html +52 -0
- data/doc/ds/matrixes/tri_matrix_rb.html +52 -0
- data/doc/ds/queues/queue_rb.html +52 -0
- data/doc/ds/stacks/stack_rb.html +52 -0
- data/doc/ds/trees/binary_heap_rb.html +52 -0
- data/doc/ds/trees/binary_search_tree_rb.html +52 -0
- data/doc/ds/trees/binary_tree_rb.html +52 -0
- data/doc/ds/trees/complete_binary_tree_rb.html +52 -0
- data/doc/ds/trees/tree_rb.html +52 -0
- data/doc/ds/trees/tree_walker_rb.html +52 -0
- data/doc/ds/version_rb.html +52 -0
- data/doc/ds_rb.html +98 -0
- data/doc/ext/ext_rb.html +52 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +375 -0
- data/doc/js/darkfish.js +116 -0
- data/doc/js/jquery.js +32 -0
- data/doc/js/quicksearch.js +114 -0
- data/doc/js/thickbox-compressed.js +10 -0
- data/doc/rdoc.css +763 -0
- data/ds.gemspec +20 -0
- data/lib/ds.rb +38 -0
- data/lib/ds/graphs/digraph.rb +20 -0
- data/lib/ds/graphs/edge.rb +15 -0
- data/lib/ds/graphs/graph.rb +107 -0
- data/lib/ds/graphs/graph_as_list.rb +48 -0
- data/lib/ds/graphs/graph_as_matrix.rb +114 -0
- data/lib/ds/graphs/graph_as_tri_matrix.rb +25 -0
- data/lib/ds/lists/cyclic_list.rb +21 -0
- data/lib/ds/lists/list.rb +303 -0
- data/lib/ds/lists/list_element.rb +26 -0
- data/lib/ds/lists/ring.rb +42 -0
- data/lib/ds/matrixes/array_2d.rb +35 -0
- data/lib/ds/matrixes/expandable_array.rb +37 -0
- data/lib/ds/matrixes/tri_matrix.rb +30 -0
- data/lib/ds/queues/queue.rb +53 -0
- data/lib/ds/stacks/stack.rb +39 -0
- data/lib/ds/trees/binary_heap.rb +71 -0
- data/lib/ds/trees/binary_search_tree.rb +32 -0
- data/lib/ds/trees/binary_tree.rb +65 -0
- data/lib/ds/trees/complete_binary_tree.rb +52 -0
- data/lib/ds/trees/tree.rb +117 -0
- data/lib/ds/trees/tree_walker.rb +179 -0
- data/lib/ds/version.rb +3 -0
- data/lib/ext/ext.rb +15 -0
- data/test/help.rb +8 -0
- data/test/test_array2d.rb +51 -0
- data/test/test_binary_heap.rb +35 -0
- data/test/test_binary_search_tree.rb +32 -0
- data/test/test_binary_tree.rb +51 -0
- data/test/test_complete_binary_tree.rb +30 -0
- data/test/test_digraph.rb +134 -0
- data/test/test_expandable_array.rb +26 -0
- data/test/test_graph.rb +71 -0
- data/test/test_list.rb +138 -0
- data/test/test_list_element.rb +56 -0
- data/test/test_queue.rb +110 -0
- data/test/test_ring.rb +28 -0
- data/test/test_stack.rb +87 -0
- data/test/test_tree.rb +48 -0
- data/test/test_tree_walker.rb +69 -0
- data/test/test_tri_matrix.rb +22 -0
- metadata +184 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
require 'help'
|
|
2
|
+
|
|
3
|
+
describe "List Element" do
|
|
4
|
+
|
|
5
|
+
before do
|
|
6
|
+
@empty_el = ListElement.new
|
|
7
|
+
@el = ListElement.new(1)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
describe "not initialized" do
|
|
11
|
+
|
|
12
|
+
before do
|
|
13
|
+
@empty_el = ListElement.new
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "should have no elements." do
|
|
17
|
+
@empty_el.data.must_be_nil
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "should be tail." do
|
|
21
|
+
assert @empty_el.tail?
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it "#append should link element with another." do
|
|
25
|
+
@empty_el.append(2).must_be_instance_of ListElement
|
|
26
|
+
@empty_el.next.wont_be_nil
|
|
27
|
+
@empty_el.next.must_be_instance_of ListElement
|
|
28
|
+
@empty_el.next.data.must_equal 2
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
describe "initialized" do
|
|
34
|
+
|
|
35
|
+
before do
|
|
36
|
+
@el = ListElement.new(1)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "should have one element" do
|
|
40
|
+
@el.data.must_equal 1
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
it "should be tail." do
|
|
44
|
+
assert @el.tail?
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
it "#append should link element with another." do
|
|
48
|
+
@el.append(2).must_be_instance_of ListElement
|
|
49
|
+
@el.next.wont_be_nil
|
|
50
|
+
@el.next.must_be_instance_of ListElement
|
|
51
|
+
@el.next.data.must_equal 2
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
data/test/test_queue.rb
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
require 'help'
|
|
2
|
+
|
|
3
|
+
describe Queue do
|
|
4
|
+
|
|
5
|
+
describe "Empty Queue" do
|
|
6
|
+
|
|
7
|
+
before do
|
|
8
|
+
@empty_queue = Queue.new
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it "should be empty." do
|
|
12
|
+
assert @empty_queue.empty?
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should have zero elements." do
|
|
16
|
+
@empty_queue.length.must_equal 0
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
describe "Not empty queue" do
|
|
22
|
+
|
|
23
|
+
before do
|
|
24
|
+
@queue = Queue.new
|
|
25
|
+
@queue.enqueue 1
|
|
26
|
+
@queue.enqueue 2
|
|
27
|
+
|
|
28
|
+
@queue2 = Queue.create
|
|
29
|
+
@queue2.enqueue 1
|
|
30
|
+
@queue2.enqueue 2
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it "should not be empty." do
|
|
34
|
+
refute @queue.empty?
|
|
35
|
+
@queue.length.must_equal 2
|
|
36
|
+
|
|
37
|
+
refute @queue2.empty?
|
|
38
|
+
@queue2.length.must_equal 2
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it "#peek should return element from forehead of queue." do
|
|
42
|
+
@queue.peek.must_equal 1
|
|
43
|
+
@queue2.peek.must_equal 1
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
it "#enqueue and #push should add element to queue." do
|
|
48
|
+
@queue.enqueue 3
|
|
49
|
+
@queue.length.must_equal 3
|
|
50
|
+
|
|
51
|
+
@queue.push 3
|
|
52
|
+
@queue.length.must_equal 4
|
|
53
|
+
|
|
54
|
+
@queue2.enqueue 3
|
|
55
|
+
@queue2.length.must_equal 3
|
|
56
|
+
|
|
57
|
+
@queue2.push 3
|
|
58
|
+
@queue2.length.must_equal 4
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it "#dequeue and #shift should remove element from queue." do
|
|
62
|
+
x = @queue.dequeue
|
|
63
|
+
@queue.length.must_equal 1
|
|
64
|
+
x.must_equal 1
|
|
65
|
+
|
|
66
|
+
x = @queue2.dequeue
|
|
67
|
+
@queue2.length.must_equal 1
|
|
68
|
+
x.must_equal 1
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
if ENV['BENCH']
|
|
73
|
+
describe "performance" do
|
|
74
|
+
|
|
75
|
+
before do
|
|
76
|
+
100000.times do |n|
|
|
77
|
+
@queue.push 4
|
|
78
|
+
@queue2.push 4
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
bench_performance_constant "#shift(array implementation) should be const operation.", 0.999 do |n|
|
|
84
|
+
n.times do
|
|
85
|
+
@queue.shift
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
bench_performance_constant "#shift(list implementation) should be const operation.", 0.999 do |n|
|
|
90
|
+
n.times do
|
|
91
|
+
@queue2.shift
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
bench_performance_constant "#push(array implementation) should be const operation.", 0.999 do |n|
|
|
96
|
+
n.times do
|
|
97
|
+
@queue.push 2
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
bench_performance_constant "#push(list implementation) should be const operation.", 0.999 do |n|
|
|
102
|
+
n.times do
|
|
103
|
+
@queue2.push 2
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
data/test/test_ring.rb
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require 'help'
|
|
2
|
+
|
|
3
|
+
describe "Cyclic List" do
|
|
4
|
+
|
|
5
|
+
before do
|
|
6
|
+
@ring = Ring.from_array([1,2,3,4,5,6,7])
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "#from_array should create ring from array." do
|
|
10
|
+
@ring.must_be_kind_of List
|
|
11
|
+
@ring.must_be_instance_of Ring
|
|
12
|
+
@ring.length.must_equal 7
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should be looped." do
|
|
16
|
+
assert @ring.looped?
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it "should has cycle." do
|
|
20
|
+
@ring.cycle_size.must_equal 7
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it "#eliminate_by should remove elements by given offset until there is one element." do
|
|
24
|
+
@ring.eliminate_by(3).must_equal 4
|
|
25
|
+
@ring.eliminate_by(2).must_equal 1
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
data/test/test_stack.rb
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
require 'help'
|
|
2
|
+
|
|
3
|
+
describe Stack do
|
|
4
|
+
|
|
5
|
+
before do
|
|
6
|
+
@stack = Stack.new
|
|
7
|
+
@stack.push :first
|
|
8
|
+
@stack.push :second
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
describe "Empty stack" do
|
|
12
|
+
|
|
13
|
+
before do
|
|
14
|
+
@empty_stack = Stack.new
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it "should be empty." do
|
|
18
|
+
assert @empty_stack.empty?
|
|
19
|
+
@empty_stack.size.must_equal 0
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "#pop should retrun nil." do
|
|
23
|
+
@empty_stack.pop.must_be_nil
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "#peek should return nil." do
|
|
27
|
+
@empty_stack.peek.must_be_nil
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "#push should change stack size." do
|
|
31
|
+
@empty_stack.push :first
|
|
32
|
+
refute @empty_stack.empty?
|
|
33
|
+
@empty_stack.size.must_equal 1
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
describe "Not empty stack" do
|
|
39
|
+
|
|
40
|
+
it "should not be empty." do
|
|
41
|
+
refute @stack.empty?
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it "#peek should return element from the top of the stack." do
|
|
45
|
+
@stack.peek.must_equal :second
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
it "#pop should remove element form the top of the stack." do
|
|
49
|
+
@stack.pop
|
|
50
|
+
@stack.size.must_equal 1
|
|
51
|
+
@stack.peek.must_equal :first
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
it "#push should insert element to the top of the stack." do
|
|
55
|
+
@stack.push(:third)
|
|
56
|
+
@stack.peek.must_equal :third
|
|
57
|
+
@stack.size.must_equal 3
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
if ENV['BENCH']
|
|
61
|
+
describe "performance" do
|
|
62
|
+
|
|
63
|
+
before do
|
|
64
|
+
100000.times do |n|
|
|
65
|
+
@stack.push 4
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
bench_performance_constant "#pop should be const operation.", 0.999 do |n|
|
|
71
|
+
n.times do
|
|
72
|
+
@stack.pop
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
bench_performance_constant "#push should be const operation.", 0.999 do |n|
|
|
77
|
+
n.times do
|
|
78
|
+
@stack.push 3
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
data/test/test_tree.rb
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
require 'help'
|
|
2
|
+
|
|
3
|
+
describe Tree do
|
|
4
|
+
|
|
5
|
+
before do
|
|
6
|
+
t = Tree.new(2)
|
|
7
|
+
c1 = t << 5
|
|
8
|
+
c2 = t << 8
|
|
9
|
+
t << 9
|
|
10
|
+
|
|
11
|
+
c1 << 4
|
|
12
|
+
c1 << 10
|
|
13
|
+
c2 << 3
|
|
14
|
+
|
|
15
|
+
@tree = t
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "#to_a should return tree converted to array." do
|
|
19
|
+
@tree.to_a.must_equal [2,5,8,9,4,10,3]
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "#height should return tree height." do
|
|
23
|
+
@tree.height.must_equal 3
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "#width should return tree width." do
|
|
27
|
+
@tree.width.must_equal 3
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "#leaf_count should return number of tree leaves." do
|
|
31
|
+
@tree.leaf_count.must_equal 4
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it "#get_leaves should return list of tree leaves." do
|
|
35
|
+
@tree.get_leaves.to_a.collect{ |e| e.data }.must_equal [4,10,3,9]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
it "#lowest_height should return node which lies closest to the root." do
|
|
39
|
+
@tree.lowest_height.must_equal 9
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
it "#mirror! should mirror tree." do
|
|
43
|
+
@tree.mirror!
|
|
44
|
+
@tree.to_a.must_equal [2,9,8,5,3,10,4]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
end
|
|
48
|
+
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
require "help"
|
|
2
|
+
|
|
3
|
+
describe TreeWalker do
|
|
4
|
+
|
|
5
|
+
describe "traversing Tree" do
|
|
6
|
+
|
|
7
|
+
before do
|
|
8
|
+
|
|
9
|
+
t = Tree.new(2)
|
|
10
|
+
c1 = t << 5
|
|
11
|
+
c2 = t << 8
|
|
12
|
+
t << 9
|
|
13
|
+
|
|
14
|
+
c1 << 4
|
|
15
|
+
c1 << 10
|
|
16
|
+
c2 << 3
|
|
17
|
+
|
|
18
|
+
@tree = t
|
|
19
|
+
|
|
20
|
+
@walker = TreeWalker.new(@tree)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
it "#traverse without arguments should traverse tree in BFS order." do
|
|
25
|
+
@walker.traverse.must_equal [2,5,8,9,4,10,3]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it "should traverse in BFS order." do
|
|
29
|
+
@walker.traverse(:bfs).must_equal [2,5,8,9,4,10,3]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it "#summarize should transform tree." do
|
|
33
|
+
@walker.summarize(:topdown).to_a.must_equal [2,7,10,11,11,17,13]
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
describe "traversing Binary Tree" do
|
|
38
|
+
|
|
39
|
+
before do
|
|
40
|
+
@bin_tree = BinaryTree.new
|
|
41
|
+
[2,5,8,9,11,12,14].each{|x| @bin_tree.insert(x)}
|
|
42
|
+
@bin_walker = TreeWalker.new(@bin_tree)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it "#traverse without arguments should traverse tree in BFS order." do
|
|
46
|
+
@bin_walker.traverse.must_equal [2,5,8,9,11,12,14]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
it "should traverse in BFS order." do
|
|
50
|
+
@bin_walker.traverse(:bfs).must_equal [2,5,8,9,11,12,14]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
it "should traverse in postorder." do
|
|
54
|
+
@bin_walker.traverse(:postorder).must_equal [9,11,5,12,14,8,2]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
it "should traverse in inorder." do
|
|
58
|
+
@bin_walker.traverse(:inorder).must_equal [9,5,11,2,12,8,14]
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it "#summarize should transform tree." do
|
|
62
|
+
@bin_walker.summarize(:bottomup).to_a.must_equal [61,25,34,9,11,12,14]
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require 'help'
|
|
2
|
+
|
|
3
|
+
describe TriMatrix do
|
|
4
|
+
|
|
5
|
+
before do
|
|
6
|
+
@tri_matrix = TriMatrix.new
|
|
7
|
+
@tri_matrix[0,1] = true
|
|
8
|
+
@tri_matrix[0,2] = true
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
it "[x,y] should be same as [y,x]" do
|
|
13
|
+
@tri_matrix[0,1].must_be_same_as @tri_matrix[1,0]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "should store elements in array" do
|
|
17
|
+
@tri_matrix.to_a.must_equal [0,true,0,true]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
|
metadata
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ds
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 29
|
|
5
|
+
prerelease:
|
|
6
|
+
segments:
|
|
7
|
+
- 0
|
|
8
|
+
- 0
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.0.1
|
|
11
|
+
platform: ruby
|
|
12
|
+
authors:
|
|
13
|
+
- knife
|
|
14
|
+
autorequire:
|
|
15
|
+
bindir: bin
|
|
16
|
+
cert_chain: []
|
|
17
|
+
|
|
18
|
+
date: 2011-09-07 00:00:00 Z
|
|
19
|
+
dependencies: []
|
|
20
|
+
|
|
21
|
+
description: Data structures (lists,stacks, trees, heaps, graphs..) in pure Ruby.
|
|
22
|
+
email:
|
|
23
|
+
- satre@o2.pl
|
|
24
|
+
executables: []
|
|
25
|
+
|
|
26
|
+
extensions: []
|
|
27
|
+
|
|
28
|
+
extra_rdoc_files: []
|
|
29
|
+
|
|
30
|
+
files:
|
|
31
|
+
- .gitignore
|
|
32
|
+
- Gemfile
|
|
33
|
+
- Rakefile
|
|
34
|
+
- doc/Array.html
|
|
35
|
+
- doc/DS.html
|
|
36
|
+
- doc/DS/Array2D.html
|
|
37
|
+
- doc/DS/BinaryHeap.html
|
|
38
|
+
- doc/DS/BinarySearchTree.html
|
|
39
|
+
- doc/DS/BinaryTree.html
|
|
40
|
+
- doc/DS/CompleteBinaryTree.html
|
|
41
|
+
- doc/DS/CyclicList.html
|
|
42
|
+
- doc/DS/Digraph.html
|
|
43
|
+
- doc/DS/Edge.html
|
|
44
|
+
- doc/DS/ExpandableArray.html
|
|
45
|
+
- doc/DS/Graph.html
|
|
46
|
+
- doc/DS/GraphAsList.html
|
|
47
|
+
- doc/DS/GraphAsMatrix.html
|
|
48
|
+
- doc/DS/GraphAsTriMatrix.html
|
|
49
|
+
- doc/DS/List.html
|
|
50
|
+
- doc/DS/ListElement.html
|
|
51
|
+
- doc/DS/Queue.html
|
|
52
|
+
- doc/DS/Ring.html
|
|
53
|
+
- doc/DS/Stack.html
|
|
54
|
+
- doc/DS/Tree.html
|
|
55
|
+
- doc/DS/TreeWalker.html
|
|
56
|
+
- doc/DS/TriMatrix.html
|
|
57
|
+
- doc/created.rid
|
|
58
|
+
- doc/ds/graphs/digraph_rb.html
|
|
59
|
+
- doc/ds/graphs/edge_rb.html
|
|
60
|
+
- doc/ds/graphs/graph_as_list_rb.html
|
|
61
|
+
- doc/ds/graphs/graph_as_matrix_rb.html
|
|
62
|
+
- doc/ds/graphs/graph_as_tri_matrix_rb.html
|
|
63
|
+
- doc/ds/graphs/graph_rb.html
|
|
64
|
+
- doc/ds/lists/cyclic_list_rb.html
|
|
65
|
+
- doc/ds/lists/list_element_rb.html
|
|
66
|
+
- doc/ds/lists/list_rb.html
|
|
67
|
+
- doc/ds/lists/ring_rb.html
|
|
68
|
+
- doc/ds/matrixes/array_2d_rb.html
|
|
69
|
+
- doc/ds/matrixes/expandable_array_rb.html
|
|
70
|
+
- doc/ds/matrixes/tri_matrix_rb.html
|
|
71
|
+
- doc/ds/queues/queue_rb.html
|
|
72
|
+
- doc/ds/stacks/stack_rb.html
|
|
73
|
+
- doc/ds/trees/binary_heap_rb.html
|
|
74
|
+
- doc/ds/trees/binary_search_tree_rb.html
|
|
75
|
+
- doc/ds/trees/binary_tree_rb.html
|
|
76
|
+
- doc/ds/trees/complete_binary_tree_rb.html
|
|
77
|
+
- doc/ds/trees/tree_rb.html
|
|
78
|
+
- doc/ds/trees/tree_walker_rb.html
|
|
79
|
+
- doc/ds/version_rb.html
|
|
80
|
+
- doc/ds_rb.html
|
|
81
|
+
- doc/ext/ext_rb.html
|
|
82
|
+
- doc/images/brick.png
|
|
83
|
+
- doc/images/brick_link.png
|
|
84
|
+
- doc/images/bug.png
|
|
85
|
+
- doc/images/bullet_black.png
|
|
86
|
+
- doc/images/bullet_toggle_minus.png
|
|
87
|
+
- doc/images/bullet_toggle_plus.png
|
|
88
|
+
- doc/images/date.png
|
|
89
|
+
- doc/images/find.png
|
|
90
|
+
- doc/images/loadingAnimation.gif
|
|
91
|
+
- doc/images/macFFBgHack.png
|
|
92
|
+
- doc/images/package.png
|
|
93
|
+
- doc/images/page_green.png
|
|
94
|
+
- doc/images/page_white_text.png
|
|
95
|
+
- doc/images/page_white_width.png
|
|
96
|
+
- doc/images/plugin.png
|
|
97
|
+
- doc/images/ruby.png
|
|
98
|
+
- doc/images/tag_green.png
|
|
99
|
+
- doc/images/wrench.png
|
|
100
|
+
- doc/images/wrench_orange.png
|
|
101
|
+
- doc/images/zoom.png
|
|
102
|
+
- doc/index.html
|
|
103
|
+
- doc/js/darkfish.js
|
|
104
|
+
- doc/js/jquery.js
|
|
105
|
+
- doc/js/quicksearch.js
|
|
106
|
+
- doc/js/thickbox-compressed.js
|
|
107
|
+
- doc/rdoc.css
|
|
108
|
+
- ds.gemspec
|
|
109
|
+
- lib/ds.rb
|
|
110
|
+
- lib/ds/graphs/digraph.rb
|
|
111
|
+
- lib/ds/graphs/edge.rb
|
|
112
|
+
- lib/ds/graphs/graph.rb
|
|
113
|
+
- lib/ds/graphs/graph_as_list.rb
|
|
114
|
+
- lib/ds/graphs/graph_as_matrix.rb
|
|
115
|
+
- lib/ds/graphs/graph_as_tri_matrix.rb
|
|
116
|
+
- lib/ds/lists/cyclic_list.rb
|
|
117
|
+
- lib/ds/lists/list.rb
|
|
118
|
+
- lib/ds/lists/list_element.rb
|
|
119
|
+
- lib/ds/lists/ring.rb
|
|
120
|
+
- lib/ds/matrixes/array_2d.rb
|
|
121
|
+
- lib/ds/matrixes/expandable_array.rb
|
|
122
|
+
- lib/ds/matrixes/tri_matrix.rb
|
|
123
|
+
- lib/ds/queues/queue.rb
|
|
124
|
+
- lib/ds/stacks/stack.rb
|
|
125
|
+
- lib/ds/trees/binary_heap.rb
|
|
126
|
+
- lib/ds/trees/binary_search_tree.rb
|
|
127
|
+
- lib/ds/trees/binary_tree.rb
|
|
128
|
+
- lib/ds/trees/complete_binary_tree.rb
|
|
129
|
+
- lib/ds/trees/tree.rb
|
|
130
|
+
- lib/ds/trees/tree_walker.rb
|
|
131
|
+
- lib/ds/version.rb
|
|
132
|
+
- lib/ext/ext.rb
|
|
133
|
+
- test/help.rb
|
|
134
|
+
- test/test_array2d.rb
|
|
135
|
+
- test/test_binary_heap.rb
|
|
136
|
+
- test/test_binary_search_tree.rb
|
|
137
|
+
- test/test_binary_tree.rb
|
|
138
|
+
- test/test_complete_binary_tree.rb
|
|
139
|
+
- test/test_digraph.rb
|
|
140
|
+
- test/test_expandable_array.rb
|
|
141
|
+
- test/test_graph.rb
|
|
142
|
+
- test/test_list.rb
|
|
143
|
+
- test/test_list_element.rb
|
|
144
|
+
- test/test_queue.rb
|
|
145
|
+
- test/test_ring.rb
|
|
146
|
+
- test/test_stack.rb
|
|
147
|
+
- test/test_tree.rb
|
|
148
|
+
- test/test_tree_walker.rb
|
|
149
|
+
- test/test_tri_matrix.rb
|
|
150
|
+
homepage: ""
|
|
151
|
+
licenses: []
|
|
152
|
+
|
|
153
|
+
post_install_message:
|
|
154
|
+
rdoc_options: []
|
|
155
|
+
|
|
156
|
+
require_paths:
|
|
157
|
+
- lib
|
|
158
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
159
|
+
none: false
|
|
160
|
+
requirements:
|
|
161
|
+
- - ">="
|
|
162
|
+
- !ruby/object:Gem::Version
|
|
163
|
+
hash: 3
|
|
164
|
+
segments:
|
|
165
|
+
- 0
|
|
166
|
+
version: "0"
|
|
167
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
|
+
none: false
|
|
169
|
+
requirements:
|
|
170
|
+
- - ">="
|
|
171
|
+
- !ruby/object:Gem::Version
|
|
172
|
+
hash: 3
|
|
173
|
+
segments:
|
|
174
|
+
- 0
|
|
175
|
+
version: "0"
|
|
176
|
+
requirements: []
|
|
177
|
+
|
|
178
|
+
rubyforge_project: ds
|
|
179
|
+
rubygems_version: 1.8.6
|
|
180
|
+
signing_key:
|
|
181
|
+
specification_version: 3
|
|
182
|
+
summary: Some common data structures.
|
|
183
|
+
test_files: []
|
|
184
|
+
|