Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • This is my favorite answer of them all. Dunno why it got only 6 votes. Elegant and with good complexity (provided sort is implemented well, which I'm sure it is). Commented May 6, 2020 at 21:43
  • This is the method I'm using for a while, but there's a problem with it, because you'll often get "pseudo randomized arrays" which will already have grouped and sorted items at some parts. But there's a way for improve it. Commented Jan 20, 2021 at 11:04
  • My favorite answer! Commented May 24, 2022 at 21:23
  • This is the slowest in terms of performance. If you are making it for the high demand server side code, or, for some web based game, it may have impact. see my benchmark Commented Jul 10, 2022 at 23:38