Determining whether a singly-linked list has a loop is a common interview question. But why would a linked list exist with a loop? When would a linked list with a loop be useful?
Determining whether a singly-linked list has a loop is a common interview question. But
Share
Circularly linked lists can be useful if you want to iterate through the entire list starting from a random iterator or inserting in any position. They simplify the algorithms for those operations as you don’t have to account for the beginning or end of the list.