Created
July 22, 2010 16:40
-
-
Save slembcke/486214 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// iterating a singly linked list ring | |
// operations might include splicing or deleting elements | |
node *elt = first, *next; | |
do { | |
next = elt->next; | |
// do stuff here including modify elt->next | |
} while((elt = next) != first); | |
// is there a less verbose way? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment