CS Studentzzz
CS Studentzzz

Reputation: 77

What exactly is a Circular Doubly Linked List? C++

I have do to an assignment where we are to do a doubly linked list with no head or tail. I want to find examples of this very thing so I can understand it better. Now a Circular Doubly Linked List C++ is just that is it not? When I look up this in google I get examples with head and/or tail. I just want clarification so I do not make a mistake and be way behind. I have asked the professor but I do not think he checks his emails as often as I would like.

Upvotes: 2

Views: 400

Answers (2)

paulsm4
paulsm4

Reputation: 121649

Simple:

  1. A "linked list" is when each node contains a pointer to the next.

  2. A "doubly linked list" is where each node contains both a forward pointer (to the next element), and a backward pointer (to the previous element).

  3. Finally, a "circular doubly linked list" has a finite length - the final element points forward to the first and the first points backward to the last, in a "circle".

Upvotes: 13

Orlando Wiley
Orlando Wiley

Reputation: 1

Every link list be composed of nodes.

Every node will be composed of tuples which are composed of (elements, links).

Every element is the very thing that is contained.

Every link is a pointer to another node.

Next circular linked list are those that have the link connected in such a way where when one transverse the links one can arrive to the start without any change in direction.

This is can be done singularly or through multiple directions.

Upvotes: 0

Related Questions