#include <DS_LinkedList.h>
By Kevin Jenkins (http://www.rakkar.org) Initilize with the following command LinkedList<TYPE> OR CircularLinkedList<Type>
Has the following member functions
LinkedList<int> A; // Creates a Linked List of integers called A CircularLinkedList<int> B; // Creates a Circular Linked List of // integers called B A.Insert(20); // Adds 20 to A. A: 20 - current is 20 A.Insert(5); // Adds 5 to A. A: 5 20 - current is 5 A.Insert(1); // Adds 1 to A. A: 1 5 20 - current is 1 A.IsIn1); // returns true A.IsIn200); // returns false A.Find(5); // returns true and sets current to 5 A.Peek(); // returns 5 A.Find(1); // returns true and sets current to 1 (++A).Peek(); // Returns 5 A.Peek(); // Returns 5 A.Replace(10); // Replaces 5 with 10. A.Peek(); // Returns 10 A.Beginning(); // Current points to the beginning of the list at 1 (++A).Peek(); // Returns 5 A.Peek(); // Returns 10 A.Del(); // Deletes 10. Current points to the next element, which is 20 A.Peek(); // Returns 20 A.Beginning(); // Current points to the beginning of the list at 1 (++A).Peek(); // Returns 5 A.Peek(); // Returns 20 A.Clear(_FILE_AND_LINE_); // Deletes all nodes in A A.Insert(5); // A: 5 - current is 5 A.Insert(6); // A: 6 5 - current is 6 A.Insert(7); // A: 7 6 5 - current is 7 A.Clear(_FILE_AND_LINE_); B.Clear(_FILE_AND_LINE_); B.Add(10); B.Add(20); B.Add(30); B.Add(5); B.Add(2); B.Add(25); // Sorts the numbers in the list and sets the current pointer to the // first element B.sort(); // Postfix ++ just calls the prefix version and has no functional // difference. B.Peek(); // Returns 2 B++; B.Peek(); // Returns 5 B++; B.Peek(); // Returns 10 B++; B.Peek(); // Returns 20 B++; B.Peek(); // Returns 25 B++; B.Peek(); // Returns 30