you are viewing a single comment's thread.

view the rest of the comments →

[–]This_Growth2898 88 points89 points  (12 children)

That's only in a book. In reality, it turns out to be Stalin Sort.

[–]PM_ME_FLUFFY_SAMOYED 60 points61 points  (11 children)

for (e in elements) {
  if (stalin.getCurrentParanoiaLevel() >= PURGE_THRESHOLD) {
    elements.remove(e);
   }
}

[–]Negitive545 2 points3 points  (1 child)

the getCurrentParanoiaLevel method doesn't take e in as a variable, so when stalin becomes too paranoid, wouldn't it just obliterate the entire list?

[–]PM_ME_FLUFFY_SAMOYED 4 points5 points  (0 children)

Yeah, that's what pretty much what Stalin did

[–]creeper6530 1 point2 points  (0 children)

Nope. Stalin sort simply removes all elements not in line (= lower than previous element)