Let me know if I've invented a valid O(n) sorting algorithm.(adsbygoogle = window.adsbygoogle || []).push({});

Code (Text):

public void Sort ( this List<T> L )

{

// Check every second whether L is sorted

// Given enough time, natural bit flips will eventually make L sorted

while ( !L.IsSorted() ) Thread.Sleep(1000);

}

public bool IsSorted ( this List<T> L )

{

// Returns true or false depending on whether L is in ascending order

for ( int i = 1, n = L.Length; i < n; ++i ) if ( L[i-1] > L[i] ) return false;

return true;

}

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# C/++/# Is this considered a valid sorting algorithm?

**Physics Forums | Science Articles, Homework Help, Discussion**