this is a sorting algorithm that I have made. the previous one worked fine, but this time I made it so it can handle negatives and it generates its own unsorted list of numbers.
How this works is, it gets a list of unsorted numbers: [10, 2, 6, 7, 8, 4] And it checks for a specific number, starting from 1. Since we don't have 1, we go to 2, which we do have. and since we have the 2, we add it to a new list: [10, 2, 6, 7, 8, 4] [2] Now we go to 3, which we don't have, then we go to 4, none there, then 5. I think you get the point by now. So we do this until we have a sorted list: [10, 2, 6, 7, 8, 4] [2, 4, 6, 7, 8, 10] So that's how this sorting algorithm works.