Pergunta de entrevista da empresa Shadowfax Technologies

Find the middle element of the linked list.

Resposta da entrevista

Sigiloso

14 de out. de 2021

Using two pointers starting from head, while the fast pointer reached the last or second last element, the loop ran and slow pointer ends at the middle position in the end(In each iteration of loop, the slow pointer moves one position in the linked list and the fast pointer moves two positions forward).