logoalt Hacker News

pastel8739today at 1:10 AM1 replyview on HN

Ok, I’ll bite, why is this wrong?

For a list of items I and an operator LEQ which returns bool for any pair of items in I, SORT() returns a list S such that:

1. Every item in I is present exactly once in S

2. For each consecutive pair of items (S_i, S_j) in S, LEQ(S_i, S_j) is true.


Replies

inigyoutoday at 1:23 AM

SORT(1,2,3,4,5,5,6) = 1,2,3,4,5,6

show 1 reply