Hi there,
In the previous lesson, you’ve stated it’s O(1) constant time to insert a new node into the Linked List. However, the implementation for appending a new node includes a while loop which checks that will be the last node before I add the new node next to it.
Am I correct to say that insertion for Singly Linked List is O(1) except for appending a new node to a non-empty Linked List? For this particular process it should be O(n) where n is the number of nodes in the Linked List?
Thanks!