Circular link list (1)-Introduction and application

Source: Internet
Author: User
Tags data structures

In the following two articles, the basic situation of single-linked lists and doubly linked lists has been discussed.

"Single linked list-basic introduction and Insertion node", click this link. "Doubly linked list (1)-Basic introduction and Insert Node", click this link.

A circular linked list is a data structure in which all nodes are interconnected to form a ring. There are no null nodes at the tail of the list. A circular linked list can be a one-way linked list or a doubly linked list.

Benefits of the circular list:
Any node can be a head node. You can traverse a linked list from any node. As long as the first node is repeatedly accessed, it means that the traversal is over.

2) used to implement the queue data structure is very helpful group. If you use a circular list, you do not need to maintain two pointers (front and rear) for the queue. You only need to maintain a pointer to the tail node, because the trailing node of the tail node is front.

3) Circular lists are commonly used in various applications. For example, when a PC is running multiple applications, the operating system typically stores these programs in a linked list and loops through them to give each application a certain amount of time to execute. At this point, the loop linked list for the OS is very helpful group, when the end of the linked list, you can easily restart the beginning of the loop.

4) Circular doubly linked lists can be used to implement advanced data structures such as the Fibonacci heaps (Fibonacci Heap).
The Insert/delete operation of the circular list is discussed in subsequent articles.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.