Quicksort algorithm implemented in Rust language, with an easy to remember partitioning function

preview_player
Показать описание
In this video, I've shown how you can implement a quicksort algorithm in rust language. In the book Introduction to algorithms by Thomas H. Cormen, I've found an alternative to the Hoare partitioning method. I've presented it as well on the whiteboard.

Quicksort is a sorting algorithm using the divide and conquer strategy.

The main idea is that we will pick an element in the array we'll call it pivot.
Next, we need to find where this element needs to be placed so that all left elements are less or equal and everything on the right is greater. This procedure is called partitioning.

0:00 - Intro
0:13 - Quicksort explanation
2:01 - Partitioning algorithm
5:45 - Whiteboard example of partitioning
10:56 - Rust code for partitioning
19:31 - Rust code for quicksort
Рекомендации по теме
welcome to shbcf.ru