The beloved sorting algorithm.

Visual of different sorting algorithms.

The Nerd Talk:

Diagram reference.

Cost-Benefit of quicksort:

1. We don’t care about maintaining the order of the items (stability isn’t essential to us).

2. We want to use an algorithm that can store all of our in the memory/space, without the use of any external space.

3. We are certain that we’ll by no means must readdress data that are looked after — or even majorly sorted.

1. We can optimize quicksort via running the recursive calls in parallel. When we run two quicksort calls in parallel, we are effectively spawning two unique tasks in an effort to run them at the same time. We type each partition of the array independently, the use of the identical quantity of area however best half of the time we did earlier than. This is often referred to as parallel quicksort.

2. Another exceptional optimization is being a little smarter about which pivot to pick. Rather than simply deciding on the first or the last element — which is a lot of what we’ve been doing — we may be a bit smarter with our algorithms. We could observe the last few factors in the list, and pick the median element from among them. This gives us an idea of what type of items are inside the list, and then we are able to do a little bit of math to pick out the excellent element as the pivot.

--

--

--

mann nahi yaar kal aana

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Where to Begin in Developing Mobile Applications

How to customize the Jupyter notebook 1.

Progressive Web Apps — Why it can be Future of Web App Development

104. Maximum Depth of Binary Tree

Setting up nginx and PHP-FPM in Docker with Unix Sockets

AWS AutoScaling Group Spot Capacity Optimised Allocation Strategy

Programming Interview Questions for Freshers

Why you should stop using systematically triple equals and focus on types

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mansi Vikram

Mansi Vikram

mann nahi yaar kal aana

More from Medium

4 Points about Biomedical Engineering for Teens to Make Better Career Decisions

Real World Use Cases Of Medical Datasets In Healthcare Industry

Pigeonhole algorithm

First class lyrics by Harlow