Nagarro Interview Question

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

Interview Answer

Anonymous

Sep 12, 2021

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