What is the dumbest code ever made that has become famous?

BogoSort is a moderately well-known algorithm to sort a list. Here’s how it works:

  1. Put the elements of the list in a random order.
  2. Check if the list is sorted. If not, start over.

BogoSort has an average running time of O((n+1)!), which is not very good. It is also the rare algorithm which has NO worst-case running time; if the input has at least two elements, it is possible for the algorithm to run for any amount of time.

Source: Quora

  • V M Krishna Reddy Tumati

    You can see this kind of code in One portal 😛