Click here to Skip to main content
12,955,768 members (58,992 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
i want to know about doubly circular linked list

specialy want to know about head node mechanism.first node and last node mechanism.

how a structure of data is stored in info part?

how many pointers are required for doubly circular linked list and there initialization also?
Posted 2-Nov-11 19:12pm
Comments
SAKryukov 3-Nov-11 1:32am
   
What, Google banned you, again? :-)
--SA
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Take a look at the following article:
Circular_doubly_linked_lists[^].

Also, Doubly-Linked and Circular Lists
[^]
  Permalink  
Comments
SAKryukov 3-Nov-11 1:33am
   
Should help, good descriptive links, my 5.
--SA
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

You need to have a node object, that has a pointer to the next node and the previous node in your list, as well as the other data you want to store in the node.

struct node
{
  int   data;
 
  node* pNext;
  node* pPrev;
};


your list object will have a head node, which is the starting node of the list.
When there is only 1 node, then the prev and next pointers will point to itself.
2 nodes, both next and prev pointers point to the other node, and keep track of which one is the head node.
3 and up, you have a connected chain of nodes, that eventually circle around back to the head, and navigation can move either way.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Implementation of Doubly Circular linked list here :)
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,719
CHill60 3,550
Maciej Los 3,153
ppolymorphe 2,060
Jochen Arndt 1,975


Advertise | Privacy | Mobile
Web01 | 2.8.170525.1 | Last Updated 3 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100