logoalt Hacker News

senderistalast Tuesday at 7:46 PM1 replyview 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

porridgeraisinyesterday at 5:01 AM

  if x > worst then worst = x