Find the 'kth' largest element in an array.
Here are two ways of solving the problem, you can use the simplest approach or use a quickselect with recursion.
The quick select is considerably more code, but it has a better average time complexity than the simplest approach.
algorithm | implementation |
---|---|
simplest | simple.py |
quickselect | quickselect.py |
This project is under GNU General Public License v3.0
Developed by Marcelo Cortez Packaged and organised by Carlos Pinto Machado