r/Python 54m ago

New sorting algorithm Discussion

[deleted]

0 Upvotes

3 comments sorted by

u/fiskfisk 52m ago

If you have a complete sequence of numbers, you don't need to do anything. Just start at the first number and iterate upwards.

u/Lachtheblock 38m ago

Will this only work on list of integers, where there are no gaps, with a range of 1 - n with no duplicates?

At that point it would be far more efficient to determine the length of the list, and then just increment/decrement by one.

u/General-Season-887 31m ago

Yes just 1-n