Fast And Slow Pointers

Middle of the Linked List

Given a singly-linked list, find the middle node of the list. If the list contains an even number of nodes, return the second middle node.

Happy Number

A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits. Repeat the…

Linked List Cycle II

Given a linked list, determine if it contains a cycle. If a cycle is present, find the node where the cycle begins and return it. If there is no cycle,…

Linked List Cycle

Given a linked list, determine if it has a cycle in it. A cycle is when a node in the linked list points to a previously visited node, forming a…