algorithm_selector 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c92f24acb4d6a2fafd53e85e8175d4df16852bad
4
- data.tar.gz: ecb1b1b2af1a69e09694f0203d47902a58e16bba
3
+ metadata.gz: a376e6c105667d3e1f30aa00c689d6caa209567f
4
+ data.tar.gz: db8a9e8f776ea09157acd5f5b8159ae0c22db606
5
5
  SHA512:
6
- metadata.gz: 36a078f0b02d232a1ee251ae9e55c94448f503f6fc2d5bcd72b042cbc3eab1db91d585fcfdaf96e0b312ca1071f579e2bc7d9a15c3ebd445ee92ada0cf2f8fab
7
- data.tar.gz: 2fe851dd30394dc7f9bff8e7c5b78b14ef9afb25931aa0500c0cd66d63cdde907ee21b68efa4152c04049bb065c4bd8f3c58b57ab9358d7c1dc31cbe7cc10cbb
6
+ metadata.gz: 5a82bc793441968d2c9e09d6e2b4ac39c5df87dc08a4d84aa067fb06561f33fa9500bce58992c1acc3b32032f0b1d984a51adee0b61fa523947fb3074972fb56
7
+ data.tar.gz: aa3f80b8936fc8e2eeb0a00a0bf0b4c4567b74d14ac1db937839b6deb4aa5ffb50a4cbeed16a2e4d1d446b15c4aa39fa557114fad7936e83bb2c6250eaed328c
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  algorithm_selector-0.1.0.gem
2
2
  algorithm_selector-0.1.1.gem
3
+ algorithm_selector-0.1.2.gem
data/.yardoc/checksums CHANGED
@@ -1,2 +1,2 @@
1
1
  lib/algorithm_selector.rb 300cdf69ec09250719da398de917f15df18d8761
2
- lib/algorithm_selector/version.rb 87587aa036583321d3bbdda4db673036572e46a9
2
+ lib/algorithm_selector/version.rb 7003767023eb9510f1fdeffc9ebaec0b15cbb3a9
Binary file
data/README.md CHANGED
@@ -36,13 +36,16 @@ Written by Joseph Bui.
36
36
  * `all(action, data_set, trials, target)`
37
37
  * Returns the times for each algorithm
38
38
  * Example:
39
+
39
40
  ```ruby
40
41
  AlgorithmSelector.all("sort", [2,1,4,3], 1000)
41
42
  AlgorithmSelector.all("search", [2,1,4,3], 1000, 4)
42
43
  ```
44
+
43
45
  * `best(action, data_set, trials, target)`
44
46
  * Returns the algorithm with the best time
45
47
  * Example:
48
+
46
49
  ```ruby
47
50
  AlgorithmSelector.best("sort", [2,1,4,3], 1000)
48
51
  AlgorithmSelector.best("search", [2,1,4,3], 1000, 4)
@@ -51,6 +54,7 @@ AlgorithmSelector.best("search", [2,1,4,3], 1000, 4)
51
54
  * `analyze(action, data_set, algorithm, trials, target)`
52
55
  * Returns time for specified algorithm or data structure
53
56
  * Example:
57
+
54
58
  ```ruby
55
59
  AlgorithmSelector.analyze("sort", [2,1,4,3], "merge_sort", 1000)
56
60
  AlgorithmSelector.analyze("search", [2,1,4,3], "linked_list", 1000, 4)
@@ -59,6 +63,7 @@ AlgorithmSelector.analyze("search", [2,1,4,3], "linked_list", 1000, 4)
59
63
  * `compare(action, data_set, first_algorithm, second_algorithm, trials, target)`
60
64
  * Returns the times of two specified algorithms for comparison
61
65
  * Example:
66
+
62
67
  ```ruby
63
68
  AlgorithmSelector.compare("sort", [2,1,4,3], "merge_sort", "quick_sort", 1000)
64
69
  AlgorithmSelector.compare("search", [2,1,4,3], "stack", "linked_list", 1000, 4)
@@ -67,6 +72,7 @@ AlgorithmSelector.compare("search", [2,1,4,3], "stack", "linked_list", 1000, 4)
67
72
  * `sort(data_set, algorithm)`
68
73
  * Returns sorted array of specified sorting algorithm
69
74
  * Example:
75
+
70
76
  ```ruby
71
77
  AlgorithmSelector.compare([2,1,4,3], "bubble_sort")
72
78
  ```
@@ -74,78 +80,102 @@ AlgorithmSelector.compare([2,1,4,3], "bubble_sort")
74
80
  ### Data Structures
75
81
 
76
82
  #### Stack
77
- * Initialize
78
- ```ruby
79
- size = 10
80
- stack = Stack.new(size)
81
- ```
82
- * Insertion
83
- ```ruby
84
- # returns nil
85
- value = 6
86
- stack.push(value)
87
- ```
88
- * Search
89
- ```ruby
90
- # returns true if found, else returns false
91
- target = 4
92
- stack.search(target)
93
- ```
83
+
84
+ * Initialize
85
+
86
+ ```ruby
87
+ size = 10
88
+ stack = Stack.new(size)
89
+ ```
90
+
91
+ * Insertion
92
+
93
+ ```ruby
94
+ # returns nil
95
+ value = 6
96
+ stack.push(value)
97
+ ```
98
+
99
+ * Search
100
+
101
+ ```ruby
102
+ # returns true if found, else returns false
103
+ target = 4
104
+ stack.search(target)
105
+ ```
94
106
 
95
107
  #### Queue
96
- * Initialize
97
- ```ruby
98
- size = 10
99
- queue = Queue.new(size)
100
- ```
101
- * Insertion
102
- ```ruby
103
- # returns nil
104
- value = 6
105
- queue.enqueue(value)
106
- ```
107
- * Search
108
- ```ruby
109
- # returns true if found, else returns false
110
- target = 4
111
- queue.search(target)
112
- ```
108
+
109
+ * Initialize
110
+
111
+ ```ruby
112
+ size = 10
113
+ queue = Queue.new(size)
114
+ ```
115
+
116
+ * Insertion
117
+
118
+ ```ruby
119
+ # returns nil
120
+ value = 6
121
+ queue.enqueue(value)
122
+ ```
123
+
124
+ * Search
125
+
126
+ ```ruby
127
+ # returns true if found, else returns false
128
+ target = 4
129
+ queue.search(target)
130
+ ```
113
131
 
114
132
  #### Linked List
115
- * Initialize
116
- ```ruby
117
- linked_list = LinkedList.new
118
- ```
119
- * Insertion
120
- ```ruby
121
- # returns nil
122
- value = 6
123
- linked_list.insert(value)
124
- ```
125
- * Search
126
- ```ruby
127
- # returns true if found, else returns false
128
- target = 4
129
- linked_list.search(target)
130
- ```
133
+
134
+ * Initialize
135
+
136
+ ```ruby
137
+ linked_list = LinkedList.new
138
+ ```
139
+
140
+ * Insertion
141
+
142
+ ```ruby
143
+ # returns nil
144
+ value = 6
145
+ linked_list.insert(value)
146
+ ```
147
+
148
+ * Search
149
+
150
+ ```ruby
151
+ # returns true if found, else returns false
152
+ target = 4
153
+ linked_list.search(target)
154
+ ```
131
155
 
132
156
  #### Binary Search Tree
133
- * Initialize
134
- ```ruby
135
- binary_tree = BinaryTree.new
136
- ```
137
- * Insertion
138
- ```ruby
139
- # returns nil
140
- value = 6
141
- binary_tree.insert(value)
142
- ```
143
- * Search
144
- ```ruby
145
- # returns true if found, else returns false
146
- target = 4
147
- binary_tree.search(target)
148
- ```
157
+
158
+ * Initialize
159
+
160
+ ```ruby
161
+ binary_tree = BinaryTree.new
162
+ ```
163
+
164
+ * Insertion
165
+
166
+ ```ruby
167
+ # returns nil
168
+ value = 6
169
+ binary_tree.insert(value)
170
+ ```
171
+
172
+ * Search
173
+
174
+ ```ruby
175
+ # returns true if found, else returns false
176
+ target = 4
177
+ binary_tree.search(target)
178
+ ```
149
179
 
150
180
  ## Installation
151
181
 
@@ -115,7 +115,7 @@
115
115
  <dt id="VERSION-constant" class="">VERSION =
116
116
 
117
117
  </dt>
118
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0.1.1</span><span class='tstring_end'>&quot;</span></span></pre></dd>
118
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0.1.2</span><span class='tstring_end'>&quot;</span></span></pre></dd>
119
119
 
120
120
  </dl>
121
121
 
@@ -506,7 +506,7 @@
506
506
  </div>
507
507
 
508
508
  <div id="footer">
509
- Generated on Sat Jul 23 23:26:27 2016 by
509
+ Generated on Sat Jul 23 23:45:47 2016 by
510
510
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
511
511
  0.9.4 (ruby-2.1.2).
512
512
  </div>
data/doc/BSTNode.html CHANGED
@@ -430,7 +430,7 @@
430
430
  </div>
431
431
 
432
432
  <div id="footer">
433
- Generated on Sat Jul 23 23:26:28 2016 by
433
+ Generated on Sat Jul 23 23:45:48 2016 by
434
434
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
435
435
  0.9.4 (ruby-2.1.2).
436
436
  </div>
data/doc/BinaryTree.html CHANGED
@@ -562,7 +562,7 @@
562
562
  </div>
563
563
 
564
564
  <div id="footer">
565
- Generated on Sat Jul 23 23:26:27 2016 by
565
+ Generated on Sat Jul 23 23:45:48 2016 by
566
566
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
567
567
  0.9.4 (ruby-2.1.2).
568
568
  </div>
data/doc/LinkNode.html CHANGED
@@ -430,7 +430,7 @@
430
430
  </div>
431
431
 
432
432
  <div id="footer">
433
- Generated on Sat Jul 23 23:26:27 2016 by
433
+ Generated on Sat Jul 23 23:45:48 2016 by
434
434
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
435
435
  0.9.4 (ruby-2.1.2).
436
436
  </div>
data/doc/LinkedList.html CHANGED
@@ -869,7 +869,7 @@
869
869
  </div>
870
870
 
871
871
  <div id="footer">
872
- Generated on Sat Jul 23 23:26:27 2016 by
872
+ Generated on Sat Jul 23 23:45:48 2016 by
873
873
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
874
874
  0.9.4 (ruby-2.1.2).
875
875
  </div>
data/doc/Queue.html CHANGED
@@ -546,7 +546,7 @@
546
546
  </div>
547
547
 
548
548
  <div id="footer">
549
- Generated on Sat Jul 23 23:26:27 2016 by
549
+ Generated on Sat Jul 23 23:45:48 2016 by
550
550
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
551
551
  0.9.4 (ruby-2.1.2).
552
552
  </div>
data/doc/Searches.html CHANGED
@@ -495,7 +495,7 @@
495
495
  </div>
496
496
 
497
497
  <div id="footer">
498
- Generated on Sat Jul 23 23:26:27 2016 by
498
+ Generated on Sat Jul 23 23:45:48 2016 by
499
499
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
500
500
  0.9.4 (ruby-2.1.2).
501
501
  </div>
data/doc/Sorts.html CHANGED
@@ -907,7 +907,7 @@ Complexity: O(n^2) Worst-Case Time Complexity: O(n^2)</p>
907
907
  </div>
908
908
 
909
909
  <div id="footer">
910
- Generated on Sat Jul 23 23:26:27 2016 by
910
+ Generated on Sat Jul 23 23:45:48 2016 by
911
911
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
912
912
  0.9.4 (ruby-2.1.2).
913
913
  </div>
data/doc/Stack.html CHANGED
@@ -700,7 +700,7 @@ Complexity: O(n)</p>
700
700
  </div>
701
701
 
702
702
  <div id="footer">
703
- Generated on Sat Jul 23 23:26:27 2016 by
703
+ Generated on Sat Jul 23 23:45:48 2016 by
704
704
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
705
705
  0.9.4 (ruby-2.1.2).
706
706
  </div>
data/doc/_index.html CHANGED
@@ -173,7 +173,7 @@
173
173
  </div>
174
174
 
175
175
  <div id="footer">
176
- Generated on Sat Jul 23 23:26:27 2016 by
176
+ Generated on Sat Jul 23 23:45:47 2016 by
177
177
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
178
178
  0.9.4 (ruby-2.1.2).
179
179
  </div>
data/doc/file.README.html CHANGED
@@ -124,89 +124,157 @@ future.</p>
124
124
  </li><li>
125
125
  <p>Returns the times for each algorithm</p>
126
126
  </li><li>
127
- <p>Example: <code>ruby AlgorithmSelector.all(&quot;sort&quot;, [2,1,4,3],
128
- 1000) AlgorithmSelector.all(&quot;search&quot;, [2,1,4,3], 1000, 4) </code></p>
129
- </li><li>
127
+ <p>Example:</p>
128
+ </li></ul>
129
+
130
+ <pre class="code ruby"><code class="ruby"><span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='int'>1000</span><span class='rparen'>)</span>
131
+ <span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>search</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='int'>1000</span><span class='comma'>,</span> <span class='int'>4</span><span class='rparen'>)</span>
132
+ </code></pre>
133
+ <ul><li>
130
134
  <p><code>best(action, data_set, trials, target)</code></p>
131
135
  </li><li>
132
136
  <p>Returns the algorithm with the best time</p>
133
137
  </li><li>
134
- <p>Example: <code>ruby AlgorithmSelector.best(&quot;sort&quot;, [2,1,4,3],
135
- 1000) AlgorithmSelector.best(&quot;search&quot;, [2,1,4,3], 1000, 4)
136
- </code></p>
137
- </li><li>
138
+ <p>Example:</p>
139
+ </li></ul>
140
+
141
+ <pre class="code ruby"><code class="ruby"><span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_best'>best</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='int'>1000</span><span class='rparen'>)</span>
142
+ <span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_best'>best</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>search</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='int'>1000</span><span class='comma'>,</span> <span class='int'>4</span><span class='rparen'>)</span>
143
+ </code></pre>
144
+ <ul><li>
138
145
  <p><code>analyze(action, data_set, algorithm, trials, target)</code></p>
139
146
  </li><li>
140
147
  <p>Returns time for specified algorithm or data structure</p>
141
148
  </li><li>
142
- <p>Example: <code>ruby AlgorithmSelector.analyze(&quot;sort&quot;, [2,1,4,3],
143
- &quot;merge_sort&quot;, 1000) AlgorithmSelector.analyze(&quot;search&quot;,
144
- [2,1,4,3], &quot;linked_list&quot;, 1000, 4) </code></p>
145
- </li><li>
149
+ <p>Example:</p>
150
+ </li></ul>
151
+
152
+ <pre class="code ruby"><code class="ruby"><span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_analyze'>analyze</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>merge_sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>1000</span><span class='rparen'>)</span>
153
+ <span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_analyze'>analyze</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>search</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>linked_list</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>1000</span><span class='comma'>,</span> <span class='int'>4</span><span class='rparen'>)</span>
154
+ </code></pre>
155
+ <ul><li>
146
156
  <p><code>compare(action, data_set, first_algorithm, second_algorithm, trials,
147
157
  target)</code></p>
148
158
  </li><li>
149
159
  <p>Returns the times of two specified algorithms for comparison</p>
150
160
  </li><li>
151
- <p>Example: <code>ruby AlgorithmSelector.compare(&quot;sort&quot;, [2,1,4,3],
152
- &quot;merge_sort&quot;, &quot;quick_sort&quot;, 1000)
153
- AlgorithmSelector.compare(&quot;search&quot;, [2,1,4,3], &quot;stack&quot;,
154
- &quot;linked_list&quot;, 1000, 4) </code></p>
155
- </li><li>
161
+ <p>Example:</p>
162
+ </li></ul>
163
+
164
+ <pre class="code ruby"><code class="ruby"><span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_compare'>compare</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>merge_sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>quick_sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>1000</span><span class='rparen'>)</span>
165
+ <span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_compare'>compare</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>search</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>stack</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>linked_list</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>1000</span><span class='comma'>,</span> <span class='int'>4</span><span class='rparen'>)</span>
166
+ </code></pre>
167
+ <ul><li>
156
168
  <p><code>sort(data_set, algorithm)</code></p>
157
169
  </li><li>
158
170
  <p>Returns sorted array of specified sorting algorithm</p>
159
171
  </li><li>
160
- <p>Example: <code>ruby AlgorithmSelector.compare([2,1,4,3],
161
- &quot;bubble_sort&quot;) </code></p>
172
+ <p>Example:</p>
162
173
  </li></ul>
163
174
 
175
+ <pre class="code ruby"><code class="ruby"><span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_compare'>compare</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bubble_sort</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
176
+ </code></pre>
177
+
164
178
  <h3 id="label-Data+Structures">Data Structures</h3>
165
179
 
166
180
  <h4 id="label-Stack">Stack</h4>
167
181
  <ul><li>
168
- <p>Initialize <code>ruby size = 10 stack = Stack.new(size) </code></p>
169
- </li><li>
170
- <p>Insertion <code>ruby # returns nil value = 6 stack.push(value)
171
- </code></p>
172
- </li><li>
173
- <p>Search <code>ruby # returns true if found, else returns false target =
174
- 4 stack.search(target) </code></p>
182
+ <p>Initialize</p>
175
183
  </li></ul>
176
184
 
185
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='int'>10</span>
186
+ <span class='id identifier rubyid_stack'>stack</span> <span class='op'>=</span> <span class='const'>Stack</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span>
187
+ </code></pre>
188
+ <ul><li>
189
+ <p>Insertion</p>
190
+ </li></ul>
191
+
192
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns nil
193
+ </span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='int'>6</span>
194
+ <span class='id identifier rubyid_stack'>stack</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
195
+ </code></pre>
196
+ <ul><li>
197
+ <p>Search</p>
198
+ </li></ul>
199
+
200
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns true if found, else returns false
201
+ </span><span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='int'>4</span>
202
+ <span class='id identifier rubyid_stack'>stack</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
203
+ </code></pre>
204
+
177
205
  <h4 id="label-Queue">Queue</h4>
178
206
  <ul><li>
179
- <p>Initialize <code>ruby size = 10 queue = Queue.new(size) </code></p>
180
- </li><li>
181
- <p>Insertion <code>ruby # returns nil value = 6 queue.enqueue(value)
182
- </code></p>
183
- </li><li>
184
- <p>Search <code>ruby # returns true if found, else returns false target =
185
- 4 queue.search(target) </code></p>
207
+ <p>Initialize</p>
208
+ </li></ul>
209
+
210
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='int'>10</span>
211
+ <span class='id identifier rubyid_queue'>queue</span> <span class='op'>=</span> <span class='const'>Queue</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span>
212
+ </code></pre>
213
+ <ul><li>
214
+ <p>Insertion</p>
215
+ </li></ul>
216
+
217
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns nil
218
+ </span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='int'>6</span>
219
+ <span class='id identifier rubyid_queue'>queue</span><span class='period'>.</span><span class='id identifier rubyid_enqueue'>enqueue</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
220
+ </code></pre>
221
+ <ul><li>
222
+ <p>Search</p>
186
223
  </li></ul>
187
224
 
225
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns true if found, else returns false
226
+ </span><span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='int'>4</span>
227
+ <span class='id identifier rubyid_queue'>queue</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
228
+ </code></pre>
229
+
188
230
  <h4 id="label-Linked+List">Linked List</h4>
189
231
  <ul><li>
190
- <p>Initialize <code>ruby linked_list = LinkedList.new </code></p>
191
- </li><li>
192
- <p>Insertion <code>ruby # returns nil value = 6
193
- linked_list.insert(value) </code></p>
194
- </li><li>
195
- <p>Search <code>ruby # returns true if found, else returns false target =
196
- 4 linked_list.search(target) </code></p>
232
+ <p>Initialize</p>
197
233
  </li></ul>
198
234
 
235
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_linked_list'>linked_list</span> <span class='op'>=</span> <span class='const'>LinkedList</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
236
+ </code></pre>
237
+ <ul><li>
238
+ <p>Insertion</p>
239
+ </li></ul>
240
+
241
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns nil
242
+ </span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='int'>6</span>
243
+ <span class='id identifier rubyid_linked_list'>linked_list</span><span class='period'>.</span><span class='id identifier rubyid_insert'>insert</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
244
+ </code></pre>
245
+ <ul><li>
246
+ <p>Search</p>
247
+ </li></ul>
248
+
249
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns true if found, else returns false
250
+ </span><span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='int'>4</span>
251
+ <span class='id identifier rubyid_linked_list'>linked_list</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
252
+ </code></pre>
253
+
199
254
  <h4 id="label-Binary+Search+Tree">Binary Search Tree</h4>
200
255
  <ul><li>
201
- <p>Initialize <code>ruby binary_tree = BinaryTree.new </code></p>
202
- </li><li>
203
- <p>Insertion <code>ruby # returns nil value = 6
204
- binary_tree.insert(value) </code></p>
205
- </li><li>
206
- <p>Search <code>ruby # returns true if found, else returns false target =
207
- 4 binary_tree.search(target) </code></p>
256
+ <p>Initialize</p>
208
257
  </li></ul>
209
258
 
259
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_binary_tree'>binary_tree</span> <span class='op'>=</span> <span class='const'>BinaryTree</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
260
+ </code></pre>
261
+ <ul><li>
262
+ <p>Insertion</p>
263
+ </li></ul>
264
+
265
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns nil
266
+ </span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='int'>6</span>
267
+ <span class='id identifier rubyid_binary_tree'>binary_tree</span><span class='period'>.</span><span class='id identifier rubyid_insert'>insert</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
268
+ </code></pre>
269
+ <ul><li>
270
+ <p>Search</p>
271
+ </li></ul>
272
+
273
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns true if found, else returns false
274
+ </span><span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='int'>4</span>
275
+ <span class='id identifier rubyid_binary_tree'>binary_tree</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
276
+ </code></pre>
277
+
210
278
  <h2 id="label-Installation">Installation</h2>
211
279
 
212
280
  <p>Add this line to your application&#39;s Gemfile:</p>
@@ -244,7 +312,7 @@ href="http://opensource.org/licenses/MIT">MIT License</a>.</p>
244
312
  </div></div>
245
313
 
246
314
  <div id="footer">
247
- Generated on Sat Jul 23 23:26:27 2016 by
315
+ Generated on Sat Jul 23 23:45:47 2016 by
248
316
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
249
317
  0.9.4 (ruby-2.1.2).
250
318
  </div>
data/doc/index.html CHANGED
@@ -124,89 +124,157 @@ future.</p>
124
124
  </li><li>
125
125
  <p>Returns the times for each algorithm</p>
126
126
  </li><li>
127
- <p>Example: <code>ruby AlgorithmSelector.all(&quot;sort&quot;, [2,1,4,3],
128
- 1000) AlgorithmSelector.all(&quot;search&quot;, [2,1,4,3], 1000, 4) </code></p>
129
- </li><li>
127
+ <p>Example:</p>
128
+ </li></ul>
129
+
130
+ <pre class="code ruby"><code class="ruby"><span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='int'>1000</span><span class='rparen'>)</span>
131
+ <span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>search</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='int'>1000</span><span class='comma'>,</span> <span class='int'>4</span><span class='rparen'>)</span>
132
+ </code></pre>
133
+ <ul><li>
130
134
  <p><code>best(action, data_set, trials, target)</code></p>
131
135
  </li><li>
132
136
  <p>Returns the algorithm with the best time</p>
133
137
  </li><li>
134
- <p>Example: <code>ruby AlgorithmSelector.best(&quot;sort&quot;, [2,1,4,3],
135
- 1000) AlgorithmSelector.best(&quot;search&quot;, [2,1,4,3], 1000, 4)
136
- </code></p>
137
- </li><li>
138
+ <p>Example:</p>
139
+ </li></ul>
140
+
141
+ <pre class="code ruby"><code class="ruby"><span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_best'>best</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='int'>1000</span><span class='rparen'>)</span>
142
+ <span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_best'>best</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>search</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='int'>1000</span><span class='comma'>,</span> <span class='int'>4</span><span class='rparen'>)</span>
143
+ </code></pre>
144
+ <ul><li>
138
145
  <p><code>analyze(action, data_set, algorithm, trials, target)</code></p>
139
146
  </li><li>
140
147
  <p>Returns time for specified algorithm or data structure</p>
141
148
  </li><li>
142
- <p>Example: <code>ruby AlgorithmSelector.analyze(&quot;sort&quot;, [2,1,4,3],
143
- &quot;merge_sort&quot;, 1000) AlgorithmSelector.analyze(&quot;search&quot;,
144
- [2,1,4,3], &quot;linked_list&quot;, 1000, 4) </code></p>
145
- </li><li>
149
+ <p>Example:</p>
150
+ </li></ul>
151
+
152
+ <pre class="code ruby"><code class="ruby"><span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_analyze'>analyze</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>merge_sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>1000</span><span class='rparen'>)</span>
153
+ <span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_analyze'>analyze</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>search</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>linked_list</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>1000</span><span class='comma'>,</span> <span class='int'>4</span><span class='rparen'>)</span>
154
+ </code></pre>
155
+ <ul><li>
146
156
  <p><code>compare(action, data_set, first_algorithm, second_algorithm, trials,
147
157
  target)</code></p>
148
158
  </li><li>
149
159
  <p>Returns the times of two specified algorithms for comparison</p>
150
160
  </li><li>
151
- <p>Example: <code>ruby AlgorithmSelector.compare(&quot;sort&quot;, [2,1,4,3],
152
- &quot;merge_sort&quot;, &quot;quick_sort&quot;, 1000)
153
- AlgorithmSelector.compare(&quot;search&quot;, [2,1,4,3], &quot;stack&quot;,
154
- &quot;linked_list&quot;, 1000, 4) </code></p>
155
- </li><li>
161
+ <p>Example:</p>
162
+ </li></ul>
163
+
164
+ <pre class="code ruby"><code class="ruby"><span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_compare'>compare</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>merge_sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>quick_sort</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>1000</span><span class='rparen'>)</span>
165
+ <span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_compare'>compare</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>search</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>stack</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>linked_list</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>1000</span><span class='comma'>,</span> <span class='int'>4</span><span class='rparen'>)</span>
166
+ </code></pre>
167
+ <ul><li>
156
168
  <p><code>sort(data_set, algorithm)</code></p>
157
169
  </li><li>
158
170
  <p>Returns sorted array of specified sorting algorithm</p>
159
171
  </li><li>
160
- <p>Example: <code>ruby AlgorithmSelector.compare([2,1,4,3],
161
- &quot;bubble_sort&quot;) </code></p>
172
+ <p>Example:</p>
162
173
  </li></ul>
163
174
 
175
+ <pre class="code ruby"><code class="ruby"><span class='const'>AlgorithmSelector</span><span class='period'>.</span><span class='id identifier rubyid_compare'>compare</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>bubble_sort</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
176
+ </code></pre>
177
+
164
178
  <h3 id="label-Data+Structures">Data Structures</h3>
165
179
 
166
180
  <h4 id="label-Stack">Stack</h4>
167
181
  <ul><li>
168
- <p>Initialize <code>ruby size = 10 stack = Stack.new(size) </code></p>
169
- </li><li>
170
- <p>Insertion <code>ruby # returns nil value = 6 stack.push(value)
171
- </code></p>
172
- </li><li>
173
- <p>Search <code>ruby # returns true if found, else returns false target =
174
- 4 stack.search(target) </code></p>
182
+ <p>Initialize</p>
175
183
  </li></ul>
176
184
 
185
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='int'>10</span>
186
+ <span class='id identifier rubyid_stack'>stack</span> <span class='op'>=</span> <span class='const'>Stack</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span>
187
+ </code></pre>
188
+ <ul><li>
189
+ <p>Insertion</p>
190
+ </li></ul>
191
+
192
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns nil
193
+ </span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='int'>6</span>
194
+ <span class='id identifier rubyid_stack'>stack</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
195
+ </code></pre>
196
+ <ul><li>
197
+ <p>Search</p>
198
+ </li></ul>
199
+
200
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns true if found, else returns false
201
+ </span><span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='int'>4</span>
202
+ <span class='id identifier rubyid_stack'>stack</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
203
+ </code></pre>
204
+
177
205
  <h4 id="label-Queue">Queue</h4>
178
206
  <ul><li>
179
- <p>Initialize <code>ruby size = 10 queue = Queue.new(size) </code></p>
180
- </li><li>
181
- <p>Insertion <code>ruby # returns nil value = 6 queue.enqueue(value)
182
- </code></p>
183
- </li><li>
184
- <p>Search <code>ruby # returns true if found, else returns false target =
185
- 4 queue.search(target) </code></p>
207
+ <p>Initialize</p>
208
+ </li></ul>
209
+
210
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='int'>10</span>
211
+ <span class='id identifier rubyid_queue'>queue</span> <span class='op'>=</span> <span class='const'>Queue</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span>
212
+ </code></pre>
213
+ <ul><li>
214
+ <p>Insertion</p>
215
+ </li></ul>
216
+
217
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns nil
218
+ </span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='int'>6</span>
219
+ <span class='id identifier rubyid_queue'>queue</span><span class='period'>.</span><span class='id identifier rubyid_enqueue'>enqueue</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
220
+ </code></pre>
221
+ <ul><li>
222
+ <p>Search</p>
186
223
  </li></ul>
187
224
 
225
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns true if found, else returns false
226
+ </span><span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='int'>4</span>
227
+ <span class='id identifier rubyid_queue'>queue</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
228
+ </code></pre>
229
+
188
230
  <h4 id="label-Linked+List">Linked List</h4>
189
231
  <ul><li>
190
- <p>Initialize <code>ruby linked_list = LinkedList.new </code></p>
191
- </li><li>
192
- <p>Insertion <code>ruby # returns nil value = 6
193
- linked_list.insert(value) </code></p>
194
- </li><li>
195
- <p>Search <code>ruby # returns true if found, else returns false target =
196
- 4 linked_list.search(target) </code></p>
232
+ <p>Initialize</p>
197
233
  </li></ul>
198
234
 
235
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_linked_list'>linked_list</span> <span class='op'>=</span> <span class='const'>LinkedList</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
236
+ </code></pre>
237
+ <ul><li>
238
+ <p>Insertion</p>
239
+ </li></ul>
240
+
241
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns nil
242
+ </span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='int'>6</span>
243
+ <span class='id identifier rubyid_linked_list'>linked_list</span><span class='period'>.</span><span class='id identifier rubyid_insert'>insert</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
244
+ </code></pre>
245
+ <ul><li>
246
+ <p>Search</p>
247
+ </li></ul>
248
+
249
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns true if found, else returns false
250
+ </span><span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='int'>4</span>
251
+ <span class='id identifier rubyid_linked_list'>linked_list</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
252
+ </code></pre>
253
+
199
254
  <h4 id="label-Binary+Search+Tree">Binary Search Tree</h4>
200
255
  <ul><li>
201
- <p>Initialize <code>ruby binary_tree = BinaryTree.new </code></p>
202
- </li><li>
203
- <p>Insertion <code>ruby # returns nil value = 6
204
- binary_tree.insert(value) </code></p>
205
- </li><li>
206
- <p>Search <code>ruby # returns true if found, else returns false target =
207
- 4 binary_tree.search(target) </code></p>
256
+ <p>Initialize</p>
208
257
  </li></ul>
209
258
 
259
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_binary_tree'>binary_tree</span> <span class='op'>=</span> <span class='const'>BinaryTree</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
260
+ </code></pre>
261
+ <ul><li>
262
+ <p>Insertion</p>
263
+ </li></ul>
264
+
265
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns nil
266
+ </span><span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='int'>6</span>
267
+ <span class='id identifier rubyid_binary_tree'>binary_tree</span><span class='period'>.</span><span class='id identifier rubyid_insert'>insert</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
268
+ </code></pre>
269
+ <ul><li>
270
+ <p>Search</p>
271
+ </li></ul>
272
+
273
+ <pre class="code ruby"><code class="ruby"><span class='comment'># returns true if found, else returns false
274
+ </span><span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='int'>4</span>
275
+ <span class='id identifier rubyid_binary_tree'>binary_tree</span><span class='period'>.</span><span class='id identifier rubyid_search'>search</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
276
+ </code></pre>
277
+
210
278
  <h2 id="label-Installation">Installation</h2>
211
279
 
212
280
  <p>Add this line to your application&#39;s Gemfile:</p>
@@ -244,7 +312,7 @@ href="http://opensource.org/licenses/MIT">MIT License</a>.</p>
244
312
  </div></div>
245
313
 
246
314
  <div id="footer">
247
- Generated on Sat Jul 23 23:26:27 2016 by
315
+ Generated on Sat Jul 23 23:45:47 2016 by
248
316
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
249
317
  0.9.4 (ruby-2.1.2).
250
318
  </div>
@@ -104,7 +104,7 @@
104
104
  </div>
105
105
 
106
106
  <div id="footer">
107
- Generated on Sat Jul 23 23:26:27 2016 by
107
+ Generated on Sat Jul 23 23:45:47 2016 by
108
108
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
109
109
  0.9.4 (ruby-2.1.2).
110
110
  </div>
@@ -1,3 +1,3 @@
1
1
  module AlgorithmSelector
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algorithm_selector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - joseph