circular-list

Does a standard implementation of a Circular List exist for C++?

I want to use a circular list. Short of implementing my own (like this person did) what are my options? Specifically what I want to do is iterate over a list of objects. When my iterator reaches the end of the list, it should automatically return to the beginning. (Yes, I realize this could be dangerous.) See Vladimir's definition ...

What are circular lists good for (in Lisp or Scheme)?

I note that Scheme and Lisp (I guess) support circular lists, and I have used circular lists in C/C++ to 'simplify' the insertion and deletion of elements, but what are they good for? Scheme ensures that they can be built and processed, but for what? Is there a 'killer' data structure that needs to be circular or tail-circular? ...

Reversing a circular deque without a sentinel

Hey Stackoverflow I'm working on my homework and I'm trying to reverse a circular-linked deque without a sentinel. Here are my data structures: struct DLink { TYPE value; struct DLink * next; struct DLink * prev; }; struct cirListDeque { int size; struct DLink *back; }; Here's my approach to reversing the deque: void revers...

Iterating circular way

I need iterate through a List but circular way. I need too add new elements to the list and iterate over all elements (olds and news elements), How I do it? Is there any data structure for them? ...

Template argument missing for boolean operator?

I'm currently creating a circular doubly-linked list as exercise. The exercise is templating the damn thing, which is proving to be quite a pain. After many, many, many error-removals I get more errors. I'd laugh at that, but I'm quite tired and exhausted now. Node.h template<class T> class Node { public: Node(T val) : data(val), n...

Is this code a Circular linkedlist

The following code was been given from our school as a sample for circular linkedlist and told each student to build a own version of circular linkedlist. Now my query is that is the following code is really a circular linkedlist ? // Program of circular linked list #include <stdio.h> #include <malloc.h> struct node { int info; ...

Circular Linked List in C

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 doubly)? ...

How should I define a good hashCode for a circular linked list in Java?

I have set up a circular linked list data structure that represents a word, and each element in the list is a letter from the word. At the bottom of my question are the class definitions of the list and element of the list. The purpose of the list data structure is to be able to compare cyclic words. So... "picture" and "turepic" are th...