educative.io

Differences with insertion and deletion at tail

Hello!

Currently in the table it says
Insert (at tail)

  • For the singly linked list takes O(n), which I agree with
  • For the list takes O(n), which i do not believe is true since appending to a list is a O(1) operation

Delete (at tail)

  • For the linked list takes O(n) which I agree with
  • For the list takes O(n), which I do not believe is true since popping a list element at the tail is a O(1) operation

Ahh gotcha so for something like C++ those would be linear operations. Cool that makes sense, thanks Ali!

1 Like