anku580 / Java-Algorithms

This repository contains java algorithms and some interview questions.
11 stars 57 forks source link

Create Randomized_Quick_Sort.java #15

Closed Amrit-Raj-Nits closed 3 years ago

Amrit-Raj-Nits commented 3 years ago

Implementation Of Quick Sort Algorithm (Randomised):- The code for randomized quicksort uses a rand() function which generates a random number between a given range. We choose a random index and swap the element at that index with the last element. After this step, we make the new last element as pivot. Generated Output for the code is as follows:-

Array before sorting:- 10 7 8 9 5 1 5 Array after sorting:- 1 5 5 7 8 9 10

Amrit-Raj-Nits commented 3 years ago

Thanks buddy!

On Thu, Oct 1, 2020 at 1:40 PM Anku Garg notifications@github.com wrote:

Merged #15 https://github.com/anku580/Java-Algorithms/pull/15 into master.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anku580/Java-Algorithms/pull/15#event-3828119720, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKOT6AA5Y3YXQYG62GB6JBDSIQ2PBANCNFSM4SACQPGA .