Erik Engheim
Jul 8, 2022

--

Thanks, I haven't analyzed your code in detail, but isn't what you are doing essentially a partial sort which is a O(N + k log k) operation?

I added a partial sort solution in my article update, but it might be interesting to have a close look at how you solved it. Maybe I need a rewrite for myself to clarify in my own head how you did id.

--

--

Erik Engheim
Erik Engheim

Written by Erik Engheim

Geek dad, living in Oslo, Norway with passion for UX, Julia programming, science, teaching, reading and writing.

No responses yet