Javascript Big O Notation
Method | Big O | Description |
---|---|---|
Array.shift() | O(n) | remove item from beginning of an array cause an index shift for all other elements in the array |
Array.unshift() | O(n) | same as above |
Method | Big O | Description |
---|---|---|
Array.shift() | O(n) | remove item from beginning of an array cause an index shift for all other elements in the array |
Array.unshift() | O(n) | same as above |