Question ^
For del
, the Big O in the worst case is O(n)
, as we have to traverse the entire list, find the element and delete it.
For slicing, it is O(k)
, where k is the slice.
Happy Learning!
Anum Hassan | Developer Advocate
educative.io
1 Like