Interview Questions and Answers : How to Delete Middle Node in a Singly Linked List

preview_player
Показать описание
If you have any comment or discussion feel free to discuss with me. I am available here...
Рекомендации по теме
Комментарии
Автор

Lets say 5 elements, so middle will be (5/2) -> 2.5. by applying ceiling function it will be 3.
so, when we reach 2nd( 3 - 1, becoz head need to be set there to get next) position(2 if 0 starting index or 3 if 1 starting index)
head.next = head.next.next

alphabeta
visit shbcf.ru