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

前端 未结 10 1071
無奈伤痛
無奈伤痛 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:11

    Circular linked lists are widely used in applications where tasks are to be repeated or in time sharing applications. Circular queue can keep a track of tasks which have been performed and which has to be performed,once the specific task is done it jumps to next one and when whole set of task is conpleted it again jumps to first task to complete the remaining job. In practical use : when you open multiple applications on your system the memory of those applications are saved in a circular fashion, you can observe this if u continuously press win+tab/alt+tab for switching applications. Also in multiplayer board games ,each player are assigned to node in the linked list and the rotation is performed

提交回复
热议问题