Skip to content

Commit

Permalink
Add day 35
Browse files Browse the repository at this point in the history
  • Loading branch information
MadhavBahl committed Feb 6, 2019
1 parent 09be041 commit 0b27ef4
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Motivate yourself to code daily till 60 days, and see the magic! Coding will bec
| [Day 32](./day32) | [Selection Sort](./day32) | [http://codetoexpress.tech/dc/day32/](http://codetoexpress.tech/dc/day32/) | **Intermediate** |
| [Day 33](./day32) | [Insertion Sort](./day33) | [http://codetoexpress.tech/dc/day33/](http://codetoexpress.tech/dc/day33/) | **Beginner** |
| [Day 34](./day34) | [Merge Sort](./day34) | [http://codetoexpress.tech/dc/day34/](http://codetoexpress.tech/dc/day34/) | **Intermediate** |
| [Day 35](./day35) | [Quick Sort](./day35) | [http://codetoexpress.tech/dc/day35/](http://codetoexpress.tech/dc/day35/) | **Intermediate** |

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

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions day35/JavaScript/mergeSort.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// To be added
46 changes: 46 additions & 0 deletions day35/README.md
Original file line number Diff line number Diff line change
@@ -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 day35/cover.png
Loading
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 0b27ef4

Please sign in to comment.