Please use Laptop/Desktop or any other large screen for the Mock Interview Session.

Linked List Cycle and Merge Sorted Lists



YouTube Video Thumbnail
Link

Watch above sample mock interview video to see how it works.
Login and Buy Premium to Start the Interview



Detect Cycle in Linked List

Detect Cycle in Linked List

Given a singly linked list, check whether the list contains a cycle or not.

A cycle occurs if a node in the list points back to a previous node, forming a loop.
Return true if a cycle is present else return False.

Constraints

  • Number of nodes in the list is between 1 and 5 × 104.