Skip to content

Commit 0b27ef4

Browse files
committed
Add day 35
1 parent 09be041 commit 0b27ef4

File tree

5 files changed

+48
-0
lines changed

5 files changed

+48
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Motivate yourself to code daily till 60 days, and see the magic! Coding will bec
6262
| [Day 32](./day32) | [Selection Sort](./day32) | [http://codetoexpress.tech/dc/day32/](http://codetoexpress.tech/dc/day32/) | **Intermediate** |
6363
| [Day 33](./day32) | [Insertion Sort](./day33) | [http://codetoexpress.tech/dc/day33/](http://codetoexpress.tech/dc/day33/) | **Beginner** |
6464
| [Day 34](./day34) | [Merge Sort](./day34) | [http://codetoexpress.tech/dc/day34/](http://codetoexpress.tech/dc/day34/) | **Intermediate** |
65+
| [Day 35](./day35) | [Quick Sort](./day35) | [http://codetoexpress.tech/dc/day35/](http://codetoexpress.tech/dc/day35/) | **Intermediate** |
6566

6667
## [More Problems](./BONUS/README.md)
6768

File renamed without changes.

day35/JavaScript/mergeSort.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// To be added

day35/README.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
![cover](./cover.png)
2+
3+
# Day 35 - Search and Sort Algorithms Part H: Quick Sort
4+
5+
Like Merge Sort, QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot.
6+
7+
## Pseudocode
8+
9+
```
10+
/* low --> Starting index, high --> Ending index */
11+
quickSort(arr[], low, high)
12+
{
13+
if (low < high)
14+
{
15+
/* pi is partitioning index, arr[pi] is now
16+
at right place */
17+
pi = partition(arr, low, high);
18+
19+
quickSort(arr, low, pi - 1); // Before pi
20+
quickSort(arr, pi + 1, high); // After pi
21+
}
22+
}
23+
```
24+
25+
Referance: https://www.geeksforgeeks.org/quick-sort/
26+
27+
## Question
28+
29+
**Type:** Divide and Conquer
30+
31+
Given an unsorted list of elements, write a program to sort the given list using quick sort.
32+
33+
**Example**
34+
35+
```
36+
input: [1, 5, 2, 7, 3, 4, 8, 9, 6]
37+
output: [1, 2, 3, 4, 5, 6, 7, 8, 9]
38+
```
39+
40+
## Solution
41+
42+
### [JavaScript Implementation](./JavaScript/mergeSort.js)
43+
44+
```js
45+
to be added
46+
```

day35/cover.png

134 KB
Loading

0 commit comments

Comments
 (0)