You are viewing a single comment's thread. Return to all comments →
Ok, kids, let's learn some Complexity 101!
both algorithms are linear, i.e. O(n).
Even the constants in their linearity are the same, because both iterate through the same number of elements!
Still confused ?
Seems like cookies are disabled on this browser, please enable them to open this website
Get Node Value
You are viewing a single comment's thread. Return to all comments →
Ok, kids, let's learn some Complexity 101!
both algorithms are linear, i.e. O(n).
Even the constants in their linearity are the same, because both iterate through the same number of elements!
Still confused ?