Nagarro interview question

Can we perform insertion in O(1) time complexity?

Interview Answer

Anonymous

12 Sept 2021

Yes. We need to maintain a pointer to the last node to keep O(1) efficiency for insertion.