queue-typed 1.47.3 → 1.47.4
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.
- package/README.md +410 -353
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -99,13 +99,14 @@ for (let i = 0; i < magnitude; i++) {
|
|
|
99
99
|
}
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
|
|
102
103
|
## API docs & Examples
|
|
103
104
|
|
|
104
105
|
[API Docs](https://data-structure-typed-docs.vercel.app)
|
|
105
106
|
|
|
106
|
-
[Live Examples](https://
|
|
107
|
+
[Live Examples](https://vivid-algorithm.vercel.app)
|
|
107
108
|
|
|
108
|
-
<a href="https://github.com/zrwusa/
|
|
109
|
+
<a href="https://github.com/zrwusa/vivid-algorithm" target="_blank">Examples Repository</a>
|
|
109
110
|
|
|
110
111
|
## Data Structures
|
|
111
112
|
|
|
@@ -115,464 +116,520 @@ for (let i = 0; i < magnitude; i++) {
|
|
|
115
116
|
<th>Data Structure</th>
|
|
116
117
|
<th>Unit Test</th>
|
|
117
118
|
<th>Performance Test</th>
|
|
118
|
-
<th>API
|
|
119
|
-
<th>Implemented</th>
|
|
119
|
+
<th>API Docs</th>
|
|
120
120
|
</tr>
|
|
121
121
|
</thead>
|
|
122
122
|
<tbody>
|
|
123
123
|
<tr>
|
|
124
124
|
<td>Binary Tree</td>
|
|
125
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""/>
|
|
126
|
-
</td>
|
|
127
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""/>
|
|
128
|
-
</td>
|
|
129
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryTree.html"><span>Binary Tree</span></a></td>
|
|
130
125
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
126
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
127
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryTree.html"><span>Binary Tree</span></a></td>
|
|
131
128
|
</tr>
|
|
132
129
|
<tr>
|
|
133
130
|
<td>Binary Search Tree (BST)</td>
|
|
134
131
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
135
132
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
136
133
|
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BST.html"><span>BST</span></a></td>
|
|
137
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
138
134
|
</tr>
|
|
139
135
|
<tr>
|
|
140
136
|
<td>AVL Tree</td>
|
|
141
137
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
142
138
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
143
139
|
<td><a href="https://data-structure-typed-docs.vercel.app/classes/AVLTree.html"><span>AVLTree</span></a></td>
|
|
140
|
+
</tr>
|
|
141
|
+
<tr>
|
|
142
|
+
<td>Red Black Tree</td>
|
|
144
143
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
144
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
145
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/RedBlackTree.html"><span>RedBlackTree</span></a></td>
|
|
145
146
|
</tr>
|
|
146
147
|
<tr>
|
|
147
148
|
<td>Tree Multiset</td>
|
|
148
149
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
149
150
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
150
151
|
<td><a href="https://data-structure-typed-docs.vercel.app/classes/TreeMultimap.html"><span>TreeMultimap</span></a></td>
|
|
151
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
152
152
|
</tr>
|
|
153
153
|
<tr>
|
|
154
154
|
<td>Segment Tree</td>
|
|
155
|
-
<td></td>
|
|
155
|
+
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
156
156
|
<td></td>
|
|
157
157
|
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SegmentTree.html"><span>SegmentTree</span></a></td>
|
|
158
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
159
158
|
</tr>
|
|
160
159
|
<tr>
|
|
161
160
|
<td>Binary Indexed Tree</td>
|
|
162
161
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
163
162
|
<td></td>
|
|
164
163
|
<td><a href="https://data-structure-typed-docs.vercel.app/classes/BinaryIndexedTree.html"><span>BinaryIndexedTree</span></a></td>
|
|
165
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
166
164
|
</tr>
|
|
167
165
|
<tr>
|
|
168
|
-
<td>
|
|
169
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
170
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
171
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/AbstractGraph.html"><span>AbstractGraph</span></a></td>
|
|
172
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
173
|
-
</tr>
|
|
174
|
-
<tr>
|
|
175
|
-
<td>Directed Graph</td>
|
|
176
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
177
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
178
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DirectedGraph.html"><span>DirectedGraph</span></a></td>
|
|
179
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
180
|
-
</tr>
|
|
181
|
-
<tr>
|
|
182
|
-
<td>Undirected Graph</td>
|
|
183
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
166
|
+
<td>Heap</td>
|
|
184
167
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
185
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/UndirectedGraph.html"><span>UndirectedGraph</span></a></td>
|
|
186
168
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
169
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Heap.html"><span>Heap</span></a></td>
|
|
187
170
|
</tr>
|
|
188
171
|
<tr>
|
|
189
|
-
<td>
|
|
190
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
172
|
+
<td>Priority Queue</td>
|
|
191
173
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
192
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>SinglyLinkedList</span></a></td>
|
|
193
174
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
175
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/PriorityQueue.html"><span>PriorityQueue</span></a></td>
|
|
194
176
|
</tr>
|
|
195
177
|
<tr>
|
|
196
|
-
<td>
|
|
197
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
178
|
+
<td>Max Priority Queue</td>
|
|
198
179
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
199
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>SinglyLinkedList</span></a></td>
|
|
200
180
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
181
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MaxPriorityQueue.html"><span>MaxPriorityQueue</span></a></td>
|
|
201
182
|
</tr>
|
|
202
183
|
<tr>
|
|
203
|
-
<td>
|
|
204
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
184
|
+
<td>Min Priority Queue</td>
|
|
205
185
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
206
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DoublyLinkedList.html"><span>DoublyLinkedList</span></a></td>
|
|
207
186
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
187
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MinPriorityQueue.html"><span>MinPriorityQueue</span></a></td>
|
|
208
188
|
</tr>
|
|
209
189
|
<tr>
|
|
210
|
-
<td>
|
|
211
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
190
|
+
<td>Trie</td>
|
|
212
191
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
213
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Queue.html"><span>Queue</span></a></td>
|
|
214
192
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
193
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Trie.html"><span>Trie</span></a></td>
|
|
215
194
|
</tr>
|
|
216
195
|
<tr>
|
|
217
|
-
<td>
|
|
218
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
196
|
+
<td>Graph</td>
|
|
219
197
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
220
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/ObjectDeque.html"><span>ObjectDeque</span></a></td>
|
|
221
198
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
199
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/AbstractGraph.html"><span>AbstractGraph</span></a></td>
|
|
222
200
|
</tr>
|
|
223
201
|
<tr>
|
|
224
|
-
<td>
|
|
225
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
202
|
+
<td>Directed Graph</td>
|
|
226
203
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
227
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/ArrayDeque.html"><span>ArrayDeque</span></a></td>
|
|
228
204
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
205
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DirectedGraph.html"><span>DirectedGraph</span></a></td>
|
|
229
206
|
</tr>
|
|
230
207
|
<tr>
|
|
231
|
-
<td>
|
|
208
|
+
<td>Undirected Graph</td>
|
|
232
209
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
233
|
-
<td></td>
|
|
234
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Stack.html"><span>Stack</span></a></td>
|
|
235
210
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
211
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/UndirectedGraph.html"><span>UndirectedGraph</span></a></td>
|
|
236
212
|
</tr>
|
|
237
|
-
|
|
238
|
-
[//]: # (<tr>)
|
|
239
|
-
|
|
240
|
-
[//]: # (<td>Hash</td>)
|
|
241
|
-
|
|
242
|
-
[//]: # (<td></td>)
|
|
243
|
-
|
|
244
|
-
[//]: # (<td></td>)
|
|
245
|
-
|
|
246
|
-
[//]: # (<td><a href="https://data-structure-typed-docs.vercel.app/classes/HashTable.html"><span>HashTable</span></a></td>)
|
|
247
|
-
|
|
248
|
-
[//]: # (<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>)
|
|
249
|
-
|
|
250
|
-
[//]: # (</tr>)
|
|
251
213
|
<tr>
|
|
252
|
-
<td>
|
|
253
|
-
<td></td>
|
|
254
|
-
<td></td>
|
|
255
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/CoordinateSet.html"><span>CoordinateSet</span></a></td>
|
|
214
|
+
<td>Queue</td>
|
|
256
215
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
257
|
-
</tr>
|
|
258
|
-
<tr>
|
|
259
|
-
<td>Coordinate Map</td>
|
|
260
|
-
<td></td>
|
|
261
|
-
<td></td>
|
|
262
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/CoordinateMap.html"><span>CoordinateMap</span></a></td>
|
|
263
216
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
217
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Queue.html"><span>Queue</span></a></td>
|
|
264
218
|
</tr>
|
|
265
219
|
<tr>
|
|
266
|
-
<td>
|
|
220
|
+
<td>Deque</td>
|
|
267
221
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
268
222
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
269
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/
|
|
270
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
223
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Deque.html"><span>Deque</span></a></td>
|
|
271
224
|
</tr>
|
|
272
225
|
<tr>
|
|
273
|
-
<td>
|
|
274
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
226
|
+
<td>Linked List</td>
|
|
275
227
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
276
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/PriorityQueue.html"><span>PriorityQueue</span></a></td>
|
|
277
228
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
229
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>SinglyLinkedList</span></a></td>
|
|
278
230
|
</tr>
|
|
279
231
|
<tr>
|
|
280
|
-
<td>
|
|
281
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
232
|
+
<td>Singly Linked List</td>
|
|
282
233
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
283
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MaxPriorityQueue.html"><span>MaxPriorityQueue</span></a></td>
|
|
284
234
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
235
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/SinglyLinkedList.html"><span>SinglyLinkedList</span></a></td>
|
|
285
236
|
</tr>
|
|
286
237
|
<tr>
|
|
287
|
-
<td>
|
|
288
|
-
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
238
|
+
<td>Doubly Linked List</td>
|
|
289
239
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
290
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/MinPriorityQueue.html"><span>MinPriorityQueue</span></a></td>
|
|
291
240
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
241
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/DoublyLinkedList.html"><span>DoublyLinkedList</span></a></td>
|
|
292
242
|
</tr>
|
|
293
243
|
<tr>
|
|
294
|
-
<td>
|
|
244
|
+
<td>Stack</td>
|
|
295
245
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
296
|
-
<td></td>
|
|
297
|
-
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Trie.html"><span>Trie</span></a></td>
|
|
298
246
|
<td><img src="https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/assets/tick.svg" alt=""></td>
|
|
247
|
+
<td><a href="https://data-structure-typed-docs.vercel.app/classes/Stack.html"><span>Stack</span></a></td>
|
|
299
248
|
</tr>
|
|
300
249
|
</tbody>
|
|
301
250
|
</table>
|
|
302
251
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
## Complexities
|
|
306
|
-
|
|
307
|
-
### performance of Big O
|
|
252
|
+
## Standard library data structure comparison
|
|
308
253
|
|
|
309
254
|
<table>
|
|
310
|
-
<thead>
|
|
311
|
-
<tr>
|
|
312
|
-
<th>
|
|
313
|
-
<th>
|
|
314
|
-
<th>
|
|
315
|
-
<th>
|
|
316
|
-
|
|
317
|
-
</
|
|
318
|
-
|
|
319
|
-
<
|
|
320
|
-
<
|
|
321
|
-
<td
|
|
322
|
-
<td>
|
|
323
|
-
<td>
|
|
324
|
-
|
|
325
|
-
<
|
|
326
|
-
|
|
327
|
-
<
|
|
328
|
-
<td
|
|
329
|
-
<td>
|
|
330
|
-
|
|
331
|
-
<
|
|
332
|
-
<td>
|
|
333
|
-
|
|
334
|
-
<
|
|
335
|
-
<td
|
|
336
|
-
|
|
337
|
-
<
|
|
338
|
-
<td>
|
|
339
|
-
<td>
|
|
340
|
-
|
|
341
|
-
<
|
|
342
|
-
|
|
343
|
-
<
|
|
344
|
-
<td>
|
|
345
|
-
<td>
|
|
346
|
-
<td>
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
<
|
|
350
|
-
<td>
|
|
351
|
-
<td
|
|
352
|
-
<td
|
|
353
|
-
<td
|
|
354
|
-
</tr>
|
|
355
|
-
<tr>
|
|
356
|
-
<td
|
|
357
|
-
<td
|
|
358
|
-
<td
|
|
359
|
-
<td
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
<
|
|
363
|
-
<td
|
|
364
|
-
<td
|
|
365
|
-
<td
|
|
366
|
-
|
|
367
|
-
<
|
|
368
|
-
|
|
369
|
-
|
|
255
|
+
<thead>
|
|
256
|
+
<tr>
|
|
257
|
+
<th>Data Structure Typed</th>
|
|
258
|
+
<th>C++ STL</th>
|
|
259
|
+
<th>java.util</th>
|
|
260
|
+
<th>Python collections</th>
|
|
261
|
+
</tr>
|
|
262
|
+
</thead>
|
|
263
|
+
<tbody>
|
|
264
|
+
<tr>
|
|
265
|
+
<td>Heap<E></td>
|
|
266
|
+
<td>priority_queue<T></td>
|
|
267
|
+
<td>PriorityQueue<E></td>
|
|
268
|
+
<td>heapq</td>
|
|
269
|
+
</tr>
|
|
270
|
+
<tr>
|
|
271
|
+
<td>Deque<E></td>
|
|
272
|
+
<td>deque<T></td>
|
|
273
|
+
<td>ArrayDeque<E></td>
|
|
274
|
+
<td>deque</td>
|
|
275
|
+
</tr>
|
|
276
|
+
<tr>
|
|
277
|
+
<td>Queue<E></td>
|
|
278
|
+
<td>queue<T></td>
|
|
279
|
+
<td>Queue<E></td>
|
|
280
|
+
<td>-</td>
|
|
281
|
+
</tr>
|
|
282
|
+
<tr>
|
|
283
|
+
<td>HashMap<K, V></td>
|
|
284
|
+
<td>unordered_map<K, V></td>
|
|
285
|
+
<td>HashMap<K, V></td>
|
|
286
|
+
<td>defaultdict</td>
|
|
287
|
+
</tr>
|
|
288
|
+
<tr>
|
|
289
|
+
<td>DoublyLinkedList<E></td>
|
|
290
|
+
<td>list<T></td>
|
|
291
|
+
<td>LinkedList<E></td>
|
|
292
|
+
<td>-</td>
|
|
293
|
+
</tr>
|
|
294
|
+
<tr>
|
|
295
|
+
<td>SinglyLinkedList<E></td>
|
|
296
|
+
<td>-</td>
|
|
297
|
+
<td>-</td>
|
|
298
|
+
<td>-</td>
|
|
299
|
+
</tr>
|
|
300
|
+
<tr>
|
|
301
|
+
<td>BinaryTree<K, V></td>
|
|
302
|
+
<td>-</td>
|
|
303
|
+
<td>-</td>
|
|
304
|
+
<td>-</td>
|
|
305
|
+
</tr>
|
|
306
|
+
<tr>
|
|
307
|
+
<td>BST<K, V></td>
|
|
308
|
+
<td>-</td>
|
|
309
|
+
<td>-</td>
|
|
310
|
+
<td>-</td>
|
|
311
|
+
</tr>
|
|
312
|
+
<tr>
|
|
313
|
+
<td>RedBlackTree<E></td>
|
|
314
|
+
<td>set<T></td>
|
|
315
|
+
<td>TreeSet<E></td>
|
|
316
|
+
<td>-</td>
|
|
317
|
+
</tr>
|
|
318
|
+
<tr>
|
|
319
|
+
<td>RedBlackTree<K, V></td>
|
|
320
|
+
<td>map<K, V></td>
|
|
321
|
+
<td>TreeMap<K, V></td>
|
|
322
|
+
<td>-</td>
|
|
323
|
+
</tr>
|
|
324
|
+
<tr>
|
|
325
|
+
<td>TreeMultimap<K, V></td>
|
|
326
|
+
<td>multimap<K, V></td>
|
|
327
|
+
<td>-</td>
|
|
328
|
+
<td>-</td>
|
|
329
|
+
</tr>
|
|
330
|
+
<tr>
|
|
331
|
+
<td>-</td>
|
|
332
|
+
<td>multiset<T></td>
|
|
333
|
+
<td>-</td>
|
|
334
|
+
<td>-</td>
|
|
335
|
+
</tr>
|
|
336
|
+
<tr>
|
|
337
|
+
<td>Trie</td>
|
|
338
|
+
<td>-</td>
|
|
339
|
+
<td>-</td>
|
|
340
|
+
<td>-</td>
|
|
341
|
+
</tr>
|
|
342
|
+
<tr>
|
|
343
|
+
<td>DirectedGraph<V, E></td>
|
|
344
|
+
<td>-</td>
|
|
345
|
+
<td>-</td>
|
|
346
|
+
<td>-</td>
|
|
347
|
+
</tr>
|
|
348
|
+
<tr>
|
|
349
|
+
<td>UndirectedGraph<V, E></td>
|
|
350
|
+
<td>-</td>
|
|
351
|
+
<td>-</td>
|
|
352
|
+
<td>-</td>
|
|
353
|
+
</tr>
|
|
354
|
+
<tr>
|
|
355
|
+
<td>PriorityQueue<E></td>
|
|
356
|
+
<td>priority_queue<T></td>
|
|
357
|
+
<td>PriorityQueue<E></td>
|
|
358
|
+
<td>-</td>
|
|
359
|
+
</tr>
|
|
360
|
+
<tr>
|
|
361
|
+
<td>Array<E></td>
|
|
362
|
+
<td>vector<T></td>
|
|
363
|
+
<td>ArrayList<E></td>
|
|
364
|
+
<td>list</td>
|
|
365
|
+
</tr>
|
|
366
|
+
<tr>
|
|
367
|
+
<td>Stack<E></td>
|
|
368
|
+
<td>stack<T></td>
|
|
369
|
+
<td>Stack<E></td>
|
|
370
|
+
<td>-</td>
|
|
371
|
+
</tr>
|
|
372
|
+
<tr>
|
|
373
|
+
<td>Set<E></td>
|
|
374
|
+
<td>-</td>
|
|
375
|
+
<td>HashSet<E></td>
|
|
376
|
+
<td>set</td>
|
|
377
|
+
</tr>
|
|
378
|
+
<tr>
|
|
379
|
+
<td>Map<K, V></td>
|
|
380
|
+
<td>-</td>
|
|
381
|
+
<td>HashMap<K, V></td>
|
|
382
|
+
<td>dict</td>
|
|
383
|
+
</tr>
|
|
384
|
+
<tr>
|
|
385
|
+
<td>-</td>
|
|
386
|
+
<td>unordered_set<T></td>
|
|
387
|
+
<td>HashSet<E></td>
|
|
388
|
+
<td>-</td>
|
|
389
|
+
</tr>
|
|
390
|
+
<tr>
|
|
391
|
+
<td>Map<K, V></td>
|
|
392
|
+
<td>-</td>
|
|
393
|
+
<td>-</td>
|
|
394
|
+
<td>OrderedDict</td>
|
|
395
|
+
</tr>
|
|
396
|
+
<tr>
|
|
397
|
+
<td>-</td>
|
|
398
|
+
<td>unordered_multiset</td>
|
|
399
|
+
<td>-</td>
|
|
400
|
+
<td>Counter</td>
|
|
401
|
+
</tr>
|
|
402
|
+
<tr>
|
|
403
|
+
<td>-</td>
|
|
404
|
+
<td>-</td>
|
|
405
|
+
<td>LinkedHashSet<E></td>
|
|
406
|
+
<td>-</td>
|
|
407
|
+
</tr>
|
|
408
|
+
<tr>
|
|
409
|
+
<td>HashMap<K, V></td>
|
|
410
|
+
<td>-</td>
|
|
411
|
+
<td>LinkedHashMap<K, V></td>
|
|
412
|
+
<td>-</td>
|
|
413
|
+
</tr>
|
|
414
|
+
<tr>
|
|
415
|
+
<td>-</td>
|
|
416
|
+
<td>unordered_multimap<K, V></td>
|
|
417
|
+
<td>-</td>
|
|
418
|
+
<td>-</td>
|
|
419
|
+
</tr>
|
|
420
|
+
<tr>
|
|
421
|
+
<td>-</td>
|
|
422
|
+
<td>bitset<N></td>
|
|
423
|
+
<td>-</td>
|
|
424
|
+
<td>-</td>
|
|
425
|
+
</tr>
|
|
426
|
+
</tbody>
|
|
370
427
|
</table>
|
|
371
428
|
|
|
372
|
-
|
|
429
|
+
## Benchmark
|
|
430
|
+
|
|
431
|
+
[//]: # (No deletion!!! Start of Replace Section)
|
|
432
|
+
<div class="json-to-html-collapse clearfix 0">
|
|
433
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>avl-tree</span></div>
|
|
434
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>31.32</td><td>31.93</td><td>3.67e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>70.90</td><td>14.10</td><td>0.00</td></tr><tr><td>10,000 addMany</td><td>40.58</td><td>24.64</td><td>4.87e-4</td></tr><tr><td>10,000 get</td><td>27.31</td><td>36.62</td><td>2.00e-4</td></tr></table></div>
|
|
435
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
436
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>binary-tree</span></div>
|
|
437
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 add randomly</td><td>12.35</td><td>80.99</td><td>7.17e-5</td></tr><tr><td>1,000 add & delete randomly</td><td>15.98</td><td>62.58</td><td>7.98e-4</td></tr><tr><td>1,000 addMany</td><td>10.96</td><td>91.27</td><td>0.00</td></tr><tr><td>1,000 get</td><td>18.61</td><td>53.73</td><td>0.00</td></tr><tr><td>1,000 dfs</td><td>164.20</td><td>6.09</td><td>0.04</td></tr><tr><td>1,000 bfs</td><td>58.84</td><td>17.00</td><td>0.01</td></tr><tr><td>1,000 morris</td><td>256.66</td><td>3.90</td><td>7.70e-4</td></tr></table></div>
|
|
438
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
439
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>bst</span></div>
|
|
440
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>31.59</td><td>31.66</td><td>2.74e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>74.56</td><td>13.41</td><td>8.32e-4</td></tr><tr><td>10,000 addMany</td><td>29.16</td><td>34.30</td><td>0.00</td></tr><tr><td>10,000 get</td><td>29.24</td><td>34.21</td><td>0.00</td></tr></table></div>
|
|
441
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
442
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>rb-tree</span></div>
|
|
443
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 add</td><td>85.85</td><td>11.65</td><td>0.00</td></tr><tr><td>100,000 add & delete randomly</td><td>211.54</td><td>4.73</td><td>0.00</td></tr><tr><td>100,000 getNode</td><td>37.92</td><td>26.37</td><td>1.65e-4</td></tr></table></div>
|
|
444
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
445
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>comparison</span></div>
|
|
446
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>SRC PQ 10,000 add</td><td>0.57</td><td>1748.73</td><td>4.96e-6</td></tr><tr><td>CJS PQ 10,000 add</td><td>0.57</td><td>1746.69</td><td>4.91e-6</td></tr><tr><td>MJS PQ 10,000 add</td><td>0.57</td><td>1749.68</td><td>4.43e-6</td></tr><tr><td>SRC PQ 10,000 add & pop</td><td>3.47</td><td>288.14</td><td>6.38e-4</td></tr><tr><td>CJS PQ 10,000 add & pop</td><td>3.39</td><td>295.36</td><td>3.90e-5</td></tr><tr><td>MJS PQ 10,000 add & pop</td><td>3.37</td><td>297.17</td><td>3.03e-5</td></tr></table></div>
|
|
447
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
448
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>directed-graph</span></div>
|
|
449
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 addVertex</td><td>0.10</td><td>9534.93</td><td>8.72e-7</td></tr><tr><td>1,000 addEdge</td><td>6.30</td><td>158.67</td><td>0.00</td></tr><tr><td>1,000 getVertex</td><td>0.05</td><td>2.16e+4</td><td>3.03e-7</td></tr><tr><td>1,000 getEdge</td><td>22.31</td><td>44.82</td><td>0.00</td></tr><tr><td>tarjan</td><td>210.90</td><td>4.74</td><td>0.01</td></tr><tr><td>tarjan all</td><td>214.72</td><td>4.66</td><td>0.01</td></tr><tr><td>topologicalSort</td><td>172.52</td><td>5.80</td><td>0.00</td></tr></table></div>
|
|
450
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
451
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>hash-map</span></div>
|
|
452
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 set</td><td>275.88</td><td>3.62</td><td>0.12</td></tr><tr><td>1,000,000 Map set</td><td>211.66</td><td>4.72</td><td>0.01</td></tr><tr><td>1,000,000 Set add</td><td>177.72</td><td>5.63</td><td>0.02</td></tr><tr><td>1,000,000 set & get</td><td>317.60</td><td>3.15</td><td>0.02</td></tr><tr><td>1,000,000 Map set & get</td><td>274.99</td><td>3.64</td><td>0.03</td></tr><tr><td>1,000,000 Set add & has</td><td>172.23</td><td>5.81</td><td>0.02</td></tr><tr><td>1,000,000 ObjKey set & get</td><td>929.40</td><td>1.08</td><td>0.07</td></tr><tr><td>1,000,000 Map ObjKey set & get</td><td>310.02</td><td>3.23</td><td>0.05</td></tr><tr><td>1,000,000 Set ObjKey add & has</td><td>283.28</td><td>3.53</td><td>0.04</td></tr></table></div>
|
|
453
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
454
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>heap</span></div>
|
|
455
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add & pop</td><td>5.80</td><td>172.35</td><td>8.78e-5</td></tr><tr><td>10,000 fib add & pop</td><td>357.92</td><td>2.79</td><td>0.00</td></tr></table></div>
|
|
456
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
457
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>doubly-linked-list</span></div>
|
|
458
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>221.57</td><td>4.51</td><td>0.03</td></tr><tr><td>1,000,000 unshift</td><td>229.02</td><td>4.37</td><td>0.07</td></tr><tr><td>1,000,000 unshift & shift</td><td>169.21</td><td>5.91</td><td>0.02</td></tr><tr><td>1,000,000 insertBefore</td><td>314.48</td><td>3.18</td><td>0.07</td></tr></table></div>
|
|
459
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
460
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>singly-linked-list</span></div>
|
|
461
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 push & pop</td><td>212.98</td><td>4.70</td><td>0.01</td></tr><tr><td>10,000 insertBefore</td><td>250.68</td><td>3.99</td><td>0.01</td></tr></table></div>
|
|
462
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
463
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>max-priority-queue</span></div>
|
|
464
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 refill & poll</td><td>8.91</td><td>112.29</td><td>2.26e-4</td></tr></table></div>
|
|
465
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
466
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>priority-queue</span></div>
|
|
467
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 add & pop</td><td>103.59</td><td>9.65</td><td>0.00</td></tr></table></div>
|
|
468
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
469
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>deque</span></div>
|
|
470
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>14.55</td><td>68.72</td><td>6.91e-4</td></tr><tr><td>1,000,000 push & pop</td><td>23.40</td><td>42.73</td><td>5.94e-4</td></tr><tr><td>1,000,000 push & shift</td><td>24.41</td><td>40.97</td><td>1.45e-4</td></tr><tr><td>1,000,000 unshift & shift</td><td>22.56</td><td>44.32</td><td>1.30e-4</td></tr></table></div>
|
|
471
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
472
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>queue</span></div>
|
|
473
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>39.90</td><td>25.07</td><td>0.01</td></tr><tr><td>1,000,000 push & shift</td><td>81.79</td><td>12.23</td><td>0.00</td></tr></table></div>
|
|
474
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
475
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>stack</span></div>
|
|
476
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>37.60</td><td>26.60</td><td>0.00</td></tr><tr><td>1,000,000 push & pop</td><td>47.01</td><td>21.27</td><td>0.00</td></tr></table></div>
|
|
477
|
+
</div><div class="json-to-html-collapse clearfix 0">
|
|
478
|
+
<div class='collapsible level0' ><span class='json-to-html-label'>trie</span></div>
|
|
479
|
+
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 push</td><td>45.97</td><td>21.76</td><td>0.00</td></tr><tr><td>100,000 getWords</td><td>66.20</td><td>15.11</td><td>0.00</td></tr></table></div>
|
|
480
|
+
</div>
|
|
481
|
+
|
|
482
|
+
[//]: # (No deletion!!! End of Replace Section)
|
|
483
|
+
|
|
484
|
+
## Built-in classic algorithms
|
|
373
485
|
|
|
374
486
|
<table>
|
|
375
|
-
<thead>
|
|
376
|
-
<tr>
|
|
377
|
-
<th>
|
|
378
|
-
<th>
|
|
379
|
-
<th>
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
<
|
|
383
|
-
|
|
384
|
-
</
|
|
385
|
-
<
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
<td>
|
|
389
|
-
|
|
390
|
-
<
|
|
391
|
-
<td>
|
|
392
|
-
<td
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
<td
|
|
396
|
-
|
|
397
|
-
<
|
|
398
|
-
<td>
|
|
399
|
-
<td>
|
|
400
|
-
|
|
401
|
-
</
|
|
402
|
-
<
|
|
403
|
-
|
|
404
|
-
<
|
|
405
|
-
<td>
|
|
406
|
-
<td>1
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
</
|
|
410
|
-
|
|
411
|
-
<
|
|
412
|
-
<td>
|
|
413
|
-
<td>
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
<td
|
|
417
|
-
</tr>
|
|
418
|
-
<tr>
|
|
419
|
-
<td
|
|
420
|
-
<td
|
|
421
|
-
<td>
|
|
422
|
-
|
|
423
|
-
<
|
|
424
|
-
<td>
|
|
425
|
-
</
|
|
426
|
-
<
|
|
427
|
-
|
|
428
|
-
<
|
|
429
|
-
<td>
|
|
430
|
-
<td>
|
|
431
|
-
<td>
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
<
|
|
435
|
-
<td
|
|
436
|
-
<td>
|
|
437
|
-
|
|
438
|
-
<
|
|
439
|
-
<td>
|
|
440
|
-
<td
|
|
441
|
-
</
|
|
442
|
-
|
|
443
|
-
<
|
|
444
|
-
<td>
|
|
445
|
-
<td>
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
<td
|
|
449
|
-
</tr>
|
|
450
|
-
<tr>
|
|
451
|
-
<td
|
|
452
|
-
<td>
|
|
453
|
-
|
|
454
|
-
<td>
|
|
455
|
-
|
|
456
|
-
<
|
|
457
|
-
</
|
|
458
|
-
<
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
<td>
|
|
462
|
-
|
|
463
|
-
<
|
|
464
|
-
<td>
|
|
465
|
-
|
|
466
|
-
|
|
487
|
+
<thead>
|
|
488
|
+
<tr>
|
|
489
|
+
<th>Algorithm</th>
|
|
490
|
+
<th>Function Description</th>
|
|
491
|
+
<th>Iteration Type</th>
|
|
492
|
+
</tr>
|
|
493
|
+
</thead>
|
|
494
|
+
<tbody>
|
|
495
|
+
<tr>
|
|
496
|
+
<td>Binary Tree DFS</td>
|
|
497
|
+
<td>Traverse a binary tree in a depth-first manner, starting from the root node, first visiting the left subtree,
|
|
498
|
+
and then the right subtree, using recursion.
|
|
499
|
+
</td>
|
|
500
|
+
<td>Recursion + Iteration</td>
|
|
501
|
+
</tr>
|
|
502
|
+
<tr>
|
|
503
|
+
<td>Binary Tree BFS</td>
|
|
504
|
+
<td>Traverse a binary tree in a breadth-first manner, starting from the root node, visiting nodes level by level
|
|
505
|
+
from left to right.
|
|
506
|
+
</td>
|
|
507
|
+
<td>Iteration</td>
|
|
508
|
+
</tr>
|
|
509
|
+
<tr>
|
|
510
|
+
<td>Graph DFS</td>
|
|
511
|
+
<td>Traverse a graph in a depth-first manner, starting from a given node, exploring along one path as deeply as
|
|
512
|
+
possible, and backtracking to explore other paths. Used for finding connected components, paths, etc.
|
|
513
|
+
</td>
|
|
514
|
+
<td>Recursion + Iteration</td>
|
|
515
|
+
</tr>
|
|
516
|
+
<tr>
|
|
517
|
+
<td>Binary Tree Morris</td>
|
|
518
|
+
<td>Morris traversal is an in-order traversal algorithm for binary trees with O(1) space complexity. It allows tree
|
|
519
|
+
traversal without additional stack or recursion.
|
|
520
|
+
</td>
|
|
521
|
+
<td>Iteration</td>
|
|
522
|
+
</tr>
|
|
523
|
+
<tr>
|
|
524
|
+
<td>Graph BFS</td>
|
|
525
|
+
<td>Traverse a graph in a breadth-first manner, starting from a given node, first visiting nodes directly connected
|
|
526
|
+
to the starting node, and then expanding level by level. Used for finding shortest paths, etc.
|
|
527
|
+
</td>
|
|
528
|
+
<td>Recursion + Iteration</td>
|
|
529
|
+
</tr>
|
|
530
|
+
<tr>
|
|
531
|
+
<td>Graph Tarjan's Algorithm</td>
|
|
532
|
+
<td>Find strongly connected components in a graph, typically implemented using depth-first search.</td>
|
|
533
|
+
<td>Recursion</td>
|
|
534
|
+
</tr>
|
|
535
|
+
<tr>
|
|
536
|
+
<td>Graph Bellman-Ford Algorithm</td>
|
|
537
|
+
<td>Finding the shortest paths from a single source, can handle negative weight edges</td>
|
|
538
|
+
<td>Iteration</td>
|
|
539
|
+
</tr>
|
|
540
|
+
<tr>
|
|
541
|
+
<td>Graph Dijkstra's Algorithm</td>
|
|
542
|
+
<td>Finding the shortest paths from a single source, cannot handle negative weight edges</td>
|
|
543
|
+
<td>Iteration</td>
|
|
544
|
+
</tr>
|
|
545
|
+
<tr>
|
|
546
|
+
<td>Graph Floyd-Warshall Algorithm</td>
|
|
547
|
+
<td>Finding the shortest paths between all pairs of nodes</td>
|
|
548
|
+
<td>Iteration</td>
|
|
549
|
+
</tr>
|
|
550
|
+
<tr>
|
|
551
|
+
<td>Graph getCycles</td>
|
|
552
|
+
<td>Find all cycles in a graph or detect the presence of cycles.</td>
|
|
553
|
+
<td>Recursion</td>
|
|
554
|
+
</tr>
|
|
555
|
+
<tr>
|
|
556
|
+
<td>Graph getCutVertexes</td>
|
|
557
|
+
<td>Find cut vertices in a graph, which are nodes that, when removed, increase the number of connected components in
|
|
558
|
+
the graph.
|
|
559
|
+
</td>
|
|
560
|
+
<td>Recursion</td>
|
|
561
|
+
</tr>
|
|
562
|
+
<tr>
|
|
563
|
+
<td>Graph getSCCs</td>
|
|
564
|
+
<td>Find strongly connected components in a graph, which are subgraphs where any two nodes can reach each other.
|
|
565
|
+
</td>
|
|
566
|
+
<td>Recursion</td>
|
|
567
|
+
</tr>
|
|
568
|
+
<tr>
|
|
569
|
+
<td>Graph getBridges</td>
|
|
570
|
+
<td>Find bridges in a graph, which are edges that, when removed, increase the number of connected components in the
|
|
571
|
+
graph.
|
|
572
|
+
</td>
|
|
573
|
+
<td>Recursion</td>
|
|
574
|
+
</tr>
|
|
575
|
+
<tr>
|
|
576
|
+
<td>Graph topologicalSort</td>
|
|
577
|
+
<td>Perform topological sorting on a directed acyclic graph (DAG) to find a linear order of nodes such that all
|
|
578
|
+
directed edges go from earlier nodes to later nodes.
|
|
579
|
+
</td>
|
|
580
|
+
<td>Recursion</td>
|
|
581
|
+
</tr>
|
|
582
|
+
</tbody>
|
|
467
583
|
</table>
|
|
468
584
|
|
|
469
|
-
|
|
470
|
-
|
|
585
|
+
## Software Engineering Design Standards
|
|
471
586
|
<table>
|
|
472
|
-
<
|
|
473
|
-
<
|
|
474
|
-
<th>
|
|
475
|
-
|
|
476
|
-
<
|
|
477
|
-
<
|
|
478
|
-
<
|
|
479
|
-
|
|
480
|
-
<
|
|
481
|
-
</
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
<tr>
|
|
485
|
-
<td
|
|
486
|
-
<td>
|
|
487
|
-
|
|
488
|
-
<
|
|
489
|
-
<td>
|
|
490
|
-
<td>
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
<
|
|
494
|
-
<td
|
|
495
|
-
|
|
496
|
-
<
|
|
497
|
-
<td>
|
|
498
|
-
<td>
|
|
499
|
-
|
|
500
|
-
<
|
|
501
|
-
</
|
|
502
|
-
<
|
|
503
|
-
|
|
504
|
-
<
|
|
505
|
-
<td>
|
|
506
|
-
<td>
|
|
507
|
-
|
|
508
|
-
<
|
|
509
|
-
<td
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
<
|
|
513
|
-
<td>
|
|
514
|
-
<td>
|
|
515
|
-
|
|
516
|
-
<td>1</td>
|
|
517
|
-
<td>No</td>
|
|
518
|
-
<td></td>
|
|
519
|
-
</tr>
|
|
520
|
-
<tr>
|
|
521
|
-
<td><strong>Merge sort</strong></td>
|
|
522
|
-
<td>n log(n)</td>
|
|
523
|
-
<td>n log(n)</td>
|
|
524
|
-
<td>n log(n)</td>
|
|
525
|
-
<td>n</td>
|
|
526
|
-
<td>Yes</td>
|
|
527
|
-
<td></td>
|
|
528
|
-
</tr>
|
|
529
|
-
<tr>
|
|
530
|
-
<td><strong>Quick sort</strong></td>
|
|
531
|
-
<td>n log(n)</td>
|
|
532
|
-
<td>n log(n)</td>
|
|
533
|
-
<td>n<sup>2</sup></td>
|
|
534
|
-
<td>log(n)</td>
|
|
535
|
-
<td>No</td>
|
|
536
|
-
<td>Quicksort is usually done in-place with O(log(n)) stack space</td>
|
|
537
|
-
</tr>
|
|
538
|
-
<tr>
|
|
539
|
-
<td><strong>Shell sort</strong></td>
|
|
540
|
-
<td>n log(n)</td>
|
|
541
|
-
<td>depends on gap sequence</td>
|
|
542
|
-
<td>n (log(n))<sup>2</sup></td>
|
|
543
|
-
<td>1</td>
|
|
544
|
-
<td>No</td>
|
|
545
|
-
<td></td>
|
|
546
|
-
</tr>
|
|
547
|
-
<tr>
|
|
548
|
-
<td><strong>Counting sort</strong></td>
|
|
549
|
-
<td>n + r</td>
|
|
550
|
-
<td>n + r</td>
|
|
551
|
-
<td>n + r</td>
|
|
552
|
-
<td>n + r</td>
|
|
553
|
-
<td>Yes</td>
|
|
554
|
-
<td>r - biggest number in array</td>
|
|
555
|
-
</tr>
|
|
556
|
-
<tr>
|
|
557
|
-
<td><strong>Radix sort</strong></td>
|
|
558
|
-
<td>n * k</td>
|
|
559
|
-
<td>n * k</td>
|
|
560
|
-
<td>n * k</td>
|
|
561
|
-
<td>n + k</td>
|
|
562
|
-
<td>Yes</td>
|
|
563
|
-
<td>k - length of longest key</td>
|
|
564
|
-
</tr>
|
|
565
|
-
</tbody>
|
|
587
|
+
<tr>
|
|
588
|
+
<th>Principle</th>
|
|
589
|
+
<th>Description</th>
|
|
590
|
+
</tr>
|
|
591
|
+
<tr>
|
|
592
|
+
<td>Practicality</td>
|
|
593
|
+
<td>Follows ES6 and ESNext standards, offering unified and considerate optional parameters, and simplifies method names.</td>
|
|
594
|
+
</tr>
|
|
595
|
+
<tr>
|
|
596
|
+
<td>Extensibility</td>
|
|
597
|
+
<td>Adheres to OOP (Object-Oriented Programming) principles, allowing inheritance for all data structures.</td>
|
|
598
|
+
</tr>
|
|
599
|
+
<tr>
|
|
600
|
+
<td>Modularization</td>
|
|
601
|
+
<td>Includes data structure modularization and independent NPM packages.</td>
|
|
602
|
+
</tr>
|
|
603
|
+
<tr>
|
|
604
|
+
<td>Efficiency</td>
|
|
605
|
+
<td>All methods provide time and space complexity, comparable to native JS performance.</td>
|
|
606
|
+
</tr>
|
|
607
|
+
<tr>
|
|
608
|
+
<td>Maintainability</td>
|
|
609
|
+
<td>Follows open-source community development standards, complete documentation, continuous integration, and adheres to TDD (Test-Driven Development) patterns.</td>
|
|
610
|
+
</tr>
|
|
611
|
+
<tr>
|
|
612
|
+
<td>Testability</td>
|
|
613
|
+
<td>Automated and customized unit testing, performance testing, and integration testing.</td>
|
|
614
|
+
</tr>
|
|
615
|
+
<tr>
|
|
616
|
+
<td>Portability</td>
|
|
617
|
+
<td>Plans for porting to Java, Python, and C++, currently achieved to 80%.</td>
|
|
618
|
+
</tr>
|
|
619
|
+
<tr>
|
|
620
|
+
<td>Reusability</td>
|
|
621
|
+
<td>Fully decoupled, minimized side effects, and adheres to OOP.</td>
|
|
622
|
+
</tr>
|
|
623
|
+
<tr>
|
|
624
|
+
<td>Security</td>
|
|
625
|
+
<td>Carefully designed security for member variables and methods. Read-write separation. Data structure software does not need to consider other security aspects.</td>
|
|
626
|
+
</tr>
|
|
627
|
+
<tr>
|
|
628
|
+
<td>Scalability</td>
|
|
629
|
+
<td>Data structure software does not involve load issues.</td>
|
|
630
|
+
</tr>
|
|
566
631
|
</table>
|
|
567
632
|
|
|
568
|
-

|
|
569
|
-
|
|
570
|
-

|
|
571
|
-
|
|
572
|
-

|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
633
|
|
|
577
634
|
|
|
578
635
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "queue-typed",
|
|
3
|
-
"version": "1.47.
|
|
3
|
+
"version": "1.47.4",
|
|
4
4
|
"description": "Queue, ArrayQueue. Javascript & Typescript Data Structure.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -115,6 +115,6 @@
|
|
|
115
115
|
"typescript": "^4.9.5"
|
|
116
116
|
},
|
|
117
117
|
"dependencies": {
|
|
118
|
-
"data-structure-typed": "^1.47.
|
|
118
|
+
"data-structure-typed": "^1.47.4"
|
|
119
119
|
}
|
|
120
120
|
}
|