logoalt Hacker News

senderista • 04/22/2025 • 1 reply • view on HN

How do you efficiently track the "worst element" without something like a max-heap? But yeah, this is a fun algorithm. I think I've seen it before but can't place it, do you remember where you came across it?


Replies

porridgeraisin • 04/23/2025

  if x > worst then worst = x
➕ show 1 reply