News for hackers. Stuff that matters.
Re:Bogo-bogosort by deletes on Saturday December 28, 2013 @06:36PM (#6977163)
My addition to the algorithm: Every time your check if arrays is sorted and it isn't, start from the very beginning throwing away all progress made so far.

I doubt this way n == 6 would finish in some normal time period.

Re:Bogo-bogosort by zardeh on Saturday December 28, 2013 @09:15PM (#6977877)
bogosort does that already.

I ran it on an the array [0,1,2,3,4,5,6] and it took between 3 hundred million and 1 billion operations (by my marginally accurate counter) and between 6 and 20 minutes, but mine was in python, not C.

Re:Bogo-bogosort by deletes on Sunday December 29, 2013 @07:24AM (#6979363)
Welcome to HN.

I was referring to OPs algorithm which was bogo-bogosort.

At first I though my change would not increase the complexity, but I think it is dependent on size of input since for every recursion there is a chance to fail and start completely over, where the number of recursion is dependent on input size. Therefore it adds to complexity.