Given the following sorting algorithm, what is the time complexity of the sort
?
function sort(arr) {
arr.forEach(i => {
setTimeout(() => console.log(i), i)
})
}
const n = [100, 1000000, 10000, 3600000, 3, 5, 0, 1, 9];
sort(n);
Output:
0
1
3
5
9
100
10000
3600000 // After 1 hour