4 ms·
Correctly me if I'm wrong but, even if mutation is neglected, isn't shift() an O(n) operation because of array reindexing? Doesn't that completely defeat the pu
by chenglou 13y ago
Correctly me if I'm wrong but, even if mutation is neglected, isn't shift() an O(n) operation because of array reindexing? Doesn't that completely defeat the purpose of the while/do while loop since they'd be O(n^2)?