Amazon Interview Question

How can you get the middle element in a Linked List

Interview Answer

Anonymous

Apr 25, 2024

By starting the parsing with two pointers. One moving twice as fast as the other. When the fast pointer reaches the end, the other one is at the middle.