19 cout <<
"List is empty !" <<
endl;
23 for (
int i = 0; i < total; i++) {
24 cout << current->data <<
" -> ";
25 current = current->next;
27 cout << head->data <<
endl;
28 cout <<
"Total element: " << total <<
endl;
33void cll::insert_front(
int new_data) {
36 newNode->data = new_data;
43 while (current->next != head) {
44 current = current->next;
47 current->next = newNode;
54void cll::insert_tail(
int new_data) {
57 newNode->data = new_data;
64 while (current->next != head) {
65 current = current->next;
67 current->next = newNode;
74int cll::get_size() {
return total; }
78bool cll::find_item(
int item_to_find) {
80 cout <<
"List is empty !" <<
endl;
84 while (current->next != head) {
85 if (current->data == item_to_find)
87 current = current->next;
94int cll::operator*() {
return head->data; }
98void cll::operator++() {
100 cout <<
"List is empty !" <<
endl;
102 node *current = head;
103 while (current->next != head) {
104 current = current->next;
106 current->next = head->next;
struct node { int data; int height; struct node *left; struct node *right;} node
for std::queue