find middle element of a linked list #softwareengineer #interview #dsalgo

preview_player
Показать описание
In this video we will learn how to find the middle element of the linked list and what is the best way to find it.

JOIN ME

#dsalgo #algorithm #interview #softwareengineer
Рекомендации по теме
Комментарии
Автор

I think it should be mentioned this is a forward list, in DLL we can simply move both the pointers from the two ends towards each other.

ronniesuvillian
Автор

Yo lo que haría seria recorrer toda la lista y luego hacer back hasta la mitad de la longitud total obtenida, creo que tendría un problema con la stack pero solucionable.

nicolashenao
Автор

use slow, fast pointers... everyone knows this ...

anirbandas
Автор

If you do this.

arr[(len(arr)//2) -1]


In python 😅😅

codestar