Why exactly do we need a “Circular Linked List” (singly or doubly) data structure?

前端 未结 10 1057
無奈伤痛
無奈伤痛 2021-01-30 08:27

Why exactly do we need a \"Circular Linked List\" (singly or doubly) data structure?

What problem does it solve that is evident with simple Linked Lists (singly or doubl

10条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 09:10

    A circular linked list can be effectively used to create a queue (FIFO) or a deque (efficient insert and remove from front and back). See http://en.wikipedia.org/wiki/Linked_list#Circularly-linked_vs._linearly-linked

提交回复
热议问题