Skip to content

Commit 0775d7c

Browse files
committed
chore: Quick sort
1 parent fc86d3e commit 0775d7c

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

README.md

+20-18
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@
4747
- [Depth First Search (DFS)](#depth-first-search-dfs)
4848
- [Algorithms Q&A](#algorithms-qa)
4949
- [Merge Sort](#merge-sort)
50-
- [Quick Sort](#quick-sort)
5150
- [Find Median Values (With Merge Sort Algorithm)](#find-median-values-with-merge-sort-algorithm)
52-
- [Quick Sort](#quick-sort-1)
53-
- [Quick Sort Implementation](#quick-sort-implementation)
51+
- [Quick Sort](#quick-sort)
5452
- [Math & Stats](#math--stats)
5553
- [Integer Division Without Using \* or /](#integer-division-without-using--or-)
5654
- [Array slice](#array-slice)
@@ -477,8 +475,20 @@ Merge Sort Implementation Visualization:
477475
- [Merge Sort Implementation Question](https://codepen.io/roopkt/pen/ExWRRgP?editors=0010)
478476
- [Merge Sort Implementation Answer](https://codepen.io/roopkt/pen/ZEeMPPL?editors=0010)
479477

478+
#### Find Median Values (With Merge Sort Algorithm)
479+
480+
2 sorted arrays find the median element. Median is the middle index its not an average of values in an sorted array.
481+
482+
![ ](https://i.imgur.com/anPm3Yx.png)
483+
484+
So in order to find median we can use the stich algorithm since arrays are already sorted. Then we can find the middle index.
485+
486+
[Find Median Values Question & Answer](src/sorting/merge-sort/find-median-values.mjs)
487+
480488
### Quick Sort
481489

490+
When Browser's are not using Merge sort they most of the time use Quick sort variations. Most powerful sorting algorithm
491+
482492
**Quick sort Algorithm**
483493

484494
![Quick sort Algorithm](https://i.imgur.com/m61xGnU.png)
@@ -499,26 +509,18 @@ Merge Sort Implementation Visualization:
499509

500510
![Quick Sort Partition Algorithm Simulation](https://i.imgur.com/CkpjhGn.png)
501511

502-
#### Find Median Values (With Merge Sort Algorithm)
503-
504-
2 sorted arrays find the median element. Median is the middle index its not an average of values in an sorted array.
505-
506-
![ ](https://i.imgur.com/anPm3Yx.png)
507-
508-
So in order to find median we can use the stich algorithm since arrays are already sorted. Then we can find the middle index.
509-
510-
[Find Median Values Question & Answer](src/sorting/merge-sort/find-median-values.mjs)
512+
![ ](https://i.imgur.com/LudZhvH.png)
511513

512-
### Quick Sort
514+
**Implement Quick Sort Algorithm Question**
515+
[Implement Quick Sort Question](https://codepen.io/roopkt/pen/NWpzMRv?editors=0010)
513516

514-
When Browser's are not using Merge sort they most of the time use Quick sort variations.
517+
**Quick Sort Answer with extra Array Space complexity O(n)**
515518

516-
![ ](https://i.imgur.com/LudZhvH.png)
519+
[Implement Quick Sort Answer](https://codepen.io/roopkt/pen/eYvKrvP?editors=0010)
517520

518-
#### Quick Sort Implementation
521+
**Quick Sort Answer in-place partition with Space complexity O(1) Most Efficient algorithm**
519522

520-
- [Implement Quick Sort Question](https://codepen.io/roopkt/pen/NWpzMRv?editors=0010)
521-
- [Implement Quick Sort Answer](https://codepen.io/roopkt/pen/eYvKrvP?editors=0010)
523+
[Implement IN place Quick Sort Answer](https://codepen.io/roopkt/pen/OJpBYKz?editors=0010)
522524

523525
## Math & Stats
524526

src/algorithms/sorting/quick-sort/quick-sort-inplace.mjs

Whitespace-only changes.

0 commit comments

Comments
 (0)