20
20
- [ Stack] ( #stack )
21
21
- [ Popping element from stack] ( #popping-element-from-stack )
22
22
- [ Queue] ( #queue )
23
- - [ Dequeue an element from Queue] ( #dequeue-an-element-from-queue )
24
23
- [ Enqueue an element in Queue] ( #enqueue-an-element-in-queue )
24
+ - [ Dequeue an element from Queue] ( #dequeue-an-element-from-queue )
25
25
- [ Tree] ( #tree )
26
26
- [ Binary Tree] ( #binary-tree )
27
27
- [ Binary Search Tree (BST)] ( #binary-search-tree-bst )
38
38
- [ Merge Sort Algorithm Simulator] ( #merge-sort-algorithm-simulator )
39
39
- [ Implement Merge Sort] ( #implement-merge-sort )
40
40
- [ Find Median Values (With Merge Sort Algorithm)] ( #find-median-values-with-merge-sort-algorithm )
41
+ - [ Quick Sort] ( #quick-sort )
41
42
- [ BFS (Breath First Search)] ( #bfs-breath-first-search )
42
43
- [ Math & Stats] ( #math--stats )
43
44
- [ Integer Division Without Using \* or /] ( #integer-division-without-using--or- )
@@ -238,6 +239,16 @@ stack.pop(); // 1 , stack []
238
239
239
240
Breadth First Search (BFS) uses a ` queue ` for storing the nodes that it is visiting.
240
241
242
+ #### Enqueue an element in Queue
243
+
244
+ ``` ts
245
+ var queue = [];
246
+
247
+ queue .push (1 ); // queue [1]
248
+ queue .push (2 ); // queue [1,2]
249
+ queue .push (3 ); // queue [1,2,3]
250
+ ```
251
+
241
252
#### Dequeue an element from Queue
242
253
243
254
``` ts
@@ -248,16 +259,6 @@ queue.shift(); // 3 , queue [4]
248
259
queue .shift (); // 4 , queue []
249
260
```
250
261
251
- #### Enqueue an element in Queue
252
-
253
- ``` ts
254
- var queue = [];
255
-
256
- queue .unshift (1 ); // queue [1]
257
- queue .unshift (2 ); // queue [2,1]
258
- queue .unshift (3 ); // queue [3,2,1]
259
- ```
260
-
261
262
### Tree
262
263
263
264
A tree has hierarchical data and it has nodes.
@@ -385,6 +386,13 @@ So in order to find median we can use the stich algorithm since arrays are alrea
385
386
386
387
[ Exercise File] ( src/sorting/merge-sort/find-median-values.mjs )
387
388
389
+ ### Quick Sort
390
+
391
+ ![ ] ( https://i.imgur.com/LudZhvH.png )
392
+
393
+ - [ Implement Quick Sort Question] ( https://codepen.io/roopkt/pen/NWpzMRv?editors=0010 )
394
+ - [ Implement Quick Sort Answer] ( https://codepen.io/roopkt/pen/eYvKrvP?editors=0010 )
395
+
388
396
### BFS (Breath First Search)
389
397
390
398
## Math & Stats
0 commit comments