◆ cll()
8 {
9 head = NULL;
10 total = 0;
11}
◆ ~cll()
◆ display()
17 {
18 if (head == NULL)
20 else {
23 for (int i = 0; i < total; i++) {
24 cout << current->data <<
" -> ";
25 current = current->next;
26 }
28 cout <<
"Total element: " << total <<
endl;
29 }
30}
#define endl
Definition matrix_exponentiation.cpp:36
Definition binary_search_tree.cpp:11
◆ find_item()
bool cll::find_item |
( |
int | item_to_find | ) |
|
78 {
79 if (head == NULL) {
81 return false;
82 } else {
84 while (current->next != head) {
85 if (current->data == item_to_find)
86 return true;
87 current = current->next;
88 }
89 return false;
90 }
91}
◆ get_size()
◆ insert_front()
void cll::insert_front |
( |
int | new_data | ) |
|
33 {
36 newNode->data = new_data;
37 newNode->next = NULL;
38 if (head == NULL) {
39 head = newNode;
40 head->next = head;
41 } else {
43 while (current->next != head) {
44 current = current->next;
45 }
46 newNode->next = head;
47 current->next = newNode;
48 head = newNode;
49 }
50 total++;
51}
struct node { int data; int height; struct node *left; struct node *right;} node
for std::queue
Definition avltree.cpp:13
◆ insert_tail()
void cll::insert_tail |
( |
int | new_data | ) |
|
54 {
57 newNode->data = new_data;
58 newNode->next = NULL;
59 if (head == NULL) {
60 head = newNode;
61 head->next = head;
62 } else {
64 while (current->next != head) {
65 current = current->next;
66 }
67 current->next = newNode;
68 newNode->next = head;
69 }
70 total++;
71}
◆ operator*()
◆ operator++()
98 {
99 if (head == NULL) {
101 } else {
102 node *current = head;
103 while (current->next != head) {
104 current = current->next;
105 }
106 current->next = head->next;
107 head = head->next;
108 }
109 total--;
110}
The documentation for this class was generated from the following files:
- data_structures/cll/cll.h
- data_structures/cll/cll.cpp