Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Notation of sort function

by ikegami (Patriarch)
on Oct 27, 2023 at 19:08 UTC ( [id://11155228] : note . print w/replies, xml ) Need Help??

in reply to Notation of sort function

Is there a case in which we would specify something else for $a than for $b?


And worse, you're calculating that value n * log2(n) * 2 times.

Sort::Key and related modules provide an interface where the key is only calculated n times.