1 votes 1 votes DS linked-list data-structures + – Parshu gate asked Nov 6, 2017 Parshu gate 468 views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply Ashwani Kumar 2 commented Nov 6, 2017 reply Follow Share Option a) 0 votes 0 votes Parshu gate commented Nov 6, 2017 reply Follow Share Yes it is correct. Can u please explain how ? Because we directly have a end pointer given, just simply make the last before node as tail and delete the last node. So why do we have to traverse the entire list? 0 votes 0 votes Ashwani Kumar 2 commented Nov 6, 2017 reply Follow Share If you se we have a singly linked list given pointer to the last node, in order to delete the last node we have to free the last node(constant time bcoz pointer is given), in the same time we have to make next pointer of second last element point to NULL. So Do we have address of second last node??? No..(It is Singly linked list) That's why we have to traverse till second last node and point its next pointer to NULL and free the last node. If doubly linked,it can be done in constant time, in this case we have address of second last element too with the help of last node Hope it helps. 1 votes 1 votes Parshu gate commented Nov 6, 2017 reply Follow Share Yes , this helped me. Thank you 0 votes 0 votes Please log in or register to add a comment.