#include <LinkedList.h>
Public Member Functions | |
CircularLinkedList () | |
~CircularLinkedList () | |
CircularLinkedList (const CircularLinkedList &original_copy) | |
bool | operator= (const CircularLinkedList &original_copy) |
CircularLinkedList & | operator++ () |
CircularLinkedList & | operator++ (int) |
CircularLinkedList & | operator-- () |
CircularLinkedList & | operator-- (int) |
bool | is_in (const CircularLinkedListType &input) |
bool | find (const CircularLinkedListType &input) |
void | insert (const CircularLinkedListType &input) |
CircularLinkedListType & | add (const CircularLinkedListType &input) |
void | replace (const CircularLinkedListType &input) |
void | del (void) |
unsigned long | size (void) |
CircularLinkedListType & | peek (void) |
const CircularLinkedListType | pop (void) |
void | clear (void) |
void | sort (void) |
void | beginning (void) |
void | end (void) |
void | concatenate (const CircularLinkedList &L) |
Protected Member Functions | |
node * | find_pointer (const CircularLinkedListType &input) |
Protected Attributes | |
unsigned long | list_size |
node * | root |
node * | position |
Private Member Functions | |
CircularLinkedList | merge (CircularLinkedList L1, CircularLinkedList L2) |
CircularLinkedList | mergesort (const CircularLinkedList &L) |
Classes | |
struct | node |
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.is_in(1); // returns true A.is_in(200); // 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(); // 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(); B.clear(); 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented in BasicDataStructures::LinkedList< LinkedListType >, BasicDataStructures::LinkedList< InternalPacket * >, and BasicDataStructures::LinkedList< QueueType >. |
|
Reimplemented in BasicDataStructures::LinkedList< LinkedListType >, BasicDataStructures::LinkedList< InternalPacket * >, and BasicDataStructures::LinkedList< QueueType >. |
|
Reimplemented in BasicDataStructures::LinkedList< LinkedListType >, BasicDataStructures::LinkedList< InternalPacket * >, and BasicDataStructures::LinkedList< QueueType >. |
|
Reimplemented in BasicDataStructures::LinkedList< LinkedListType >, BasicDataStructures::LinkedList< InternalPacket * >, and BasicDataStructures::LinkedList< QueueType >. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|