0 votes 0 votes how much time take, if Insert/delete at end in linked list? a) when last element is unknown. b) when last element is known Rajnish Kumar asked Jan 23, 2017 Rajnish Kumar 313 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply rahul sharma 5 commented Jan 23, 2017 reply Follow Share You will need to tranverse till end in both the case,so it should be 0(n) only,where n is number of elements. I am assuming that by last element known you mean that the address of last node is given,but still you cant delete last node as you need modifications in second last node(sttting it null),so you need to traverse from start itself, I assumed that it is singly linked list 0 votes 0 votes srestha commented Jan 23, 2017 reply Follow Share last element is unknown means we have to traverse from first to last for insertion/deletion , time O(N) in SLL last element is known means there is a pointer to last element So, insertion time O(1) But for deletion of SLL we have to trverse previous of last element of SLL and then delete the last node, will take time O(N) 1 votes 1 votes Please log in or register to add a comment.