What is the time complexity of inserting a node at the end of a singly linked list?

  • O(1)
  • O(log n)
  • O(n)
  • O(n^2)
The time complexity of inserting a node at the end of a singly linked list is O(1) or constant time. This is because in a singly linked list, we can directly access the last node using the tail pointer and perform the insertion.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *