Timeline for Creating an O(n) algorithm for an array of integers
Current License: CC BY-SA 4.0
3 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 24, 2024 at 23:49 | comment | added | Unmitigated | @Reinderien Every element enters and leaves the stack at most once, hence the sum of the number of iterations of the inner while loop is O(n). | |
| Mar 24, 2024 at 23:31 | comment | added | Reinderien |
I'm unclear on how this is O(n). Surely the for/while exceeds O(n).
|
|
| Mar 24, 2024 at 18:45 | history | answered | Unmitigated | CC BY-SA 4.0 |