How to return k largest elements of a vector in descending order?

by @stevengj

the DataStructures.jl package already contains such a function , implemented using heaps.

Just call nlargest(n, array) from DataStructures.jl

from this discussion

3 Likes