calculating number of comparison in a vector
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
if I have a vector with N elements and want to find the maximum M elements from them, how many comparison operations I need??
4 Kommentare
Antworten (1)
Dimitris Kalogiros
am 3 Sep. 2018
It depends on the algorithm than you will use.
You can use a bubble sort routine to sort the vector and then to choose M most max elements (or min elements).
Siehe auch
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!