Skip to content

Commit 22b09dd

Browse files
committed
Add day 36
1 parent 0b27ef4 commit 22b09dd

File tree

5 files changed

+51
-26
lines changed

5 files changed

+51
-26
lines changed
File renamed without changes.

day35/README.md

+4-26
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,12 @@
11
![cover](./cover.png)
22

3-
# Day 35 - Search and Sort Algorithms Part H: Quick Sort
3+
# Day 36 - Search and Sort Algorithms Part I: Radix Sort
44

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/
5+
From quite a lot of days we are looking at searching and sorting algorithms, try out the radix sort today.
266

277
## Question
288

29-
**Type:** Divide and Conquer
30-
31-
Given an unsorted list of elements, write a program to sort the given list using quick sort.
9+
Given an unsorted list of elements, write a program to sort the given list using radix sort.
3210

3311
**Example**
3412

@@ -39,7 +17,7 @@ output: [1, 2, 3, 4, 5, 6, 7, 8, 9]
3917

4018
## Solution
4119

42-
### [JavaScript Implementation](./JavaScript/mergeSort.js)
20+
### [JavaScript Implementation](./JavaScript/radixsort.js)
4321

4422
```js
4523
to be added

day36/JavaScript/mergeSort.js

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

day36/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+
```

day36/cover.png

134 KB
Loading

0 commit comments

Comments
 (0)