Skip to content

Commit

Permalink
Add day 36
Browse files Browse the repository at this point in the history
  • Loading branch information
MadhavBahl committed Feb 7, 2019
1 parent 0b27ef4 commit 22b09dd
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 26 deletions.
File renamed without changes.
30 changes: 4 additions & 26 deletions day35/README.md
@@ -1,34 +1,12 @@
![cover](./cover.png)

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

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.

## Pseudocode

```
/* low --> Starting index, high --> Ending index */
quickSort(arr[], low, high)
{
if (low < high)
{
/* pi is partitioning index, arr[pi] is now
at right place */
pi = partition(arr, low, high);
quickSort(arr, low, pi - 1); // Before pi
quickSort(arr, pi + 1, high); // After pi
}
}
```

Referance: https://www.geeksforgeeks.org/quick-sort/
From quite a lot of days we are looking at searching and sorting algorithms, try out the radix sort today.

## Question

**Type:** Divide and Conquer

Given an unsorted list of elements, write a program to sort the given list using quick sort.
Given an unsorted list of elements, write a program to sort the given list using radix sort.

**Example**

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

## Solution

### [JavaScript Implementation](./JavaScript/mergeSort.js)
### [JavaScript Implementation](./JavaScript/radixsort.js)

```js
to be added
Expand Down
1 change: 1 addition & 0 deletions day36/JavaScript/mergeSort.js
@@ -0,0 +1 @@
// To be added
46 changes: 46 additions & 0 deletions day36/README.md
@@ -0,0 +1,46 @@
![cover](./cover.png)

# Day 35 - Search and Sort Algorithms Part H: Quick Sort

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.

## Pseudocode

```
/* low --> Starting index, high --> Ending index */
quickSort(arr[], low, high)
{
if (low < high)
{
/* pi is partitioning index, arr[pi] is now
at right place */
pi = partition(arr, low, high);
quickSort(arr, low, pi - 1); // Before pi
quickSort(arr, pi + 1, high); // After pi
}
}
```

Referance: https://www.geeksforgeeks.org/quick-sort/

## Question

**Type:** Divide and Conquer

Given an unsorted list of elements, write a program to sort the given list using quick sort.

**Example**

```
input: [1, 5, 2, 7, 3, 4, 8, 9, 6]
output: [1, 2, 3, 4, 5, 6, 7, 8, 9]
```

## Solution

### [JavaScript Implementation](./JavaScript/mergeSort.js)

```js
to be added
```
Binary file added day36/cover.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 22b09dd

Please sign in to comment.