Definition at line 10 of file queue_using_linkedlist.cpp.
◆ stack_linkedList()
stack_linkedList::stack_linkedList |
( |
| ) |
|
|
inline |
◆ dequeue()
int stack_linkedList::dequeue |
( |
| ) |
|
Definition at line 32 of file queue_using_linkedlist.cpp.
32 {
34 int ele;
35 if (front == NULL)
36 std::cout << "\nStack is empty";
37 else {
38 temp = front;
39 ele = temp->data;
40 if (front == rear)
41 rear = rear->next;
42 front = front->next;
43 delete (temp);
44 }
45 return ele;
46}
◆ display()
void stack_linkedList::display |
( |
| ) |
|
Definition at line 47 of file queue_using_linkedlist.cpp.
47 {
48 if (front == NULL)
49 std::cout << "\nStack is empty";
50
51 else {
53 temp = front;
54 while (temp != NULL) {
55 std::cout << temp->data << " ";
56 temp = temp->next;
57 }
58 }
59}
◆ enqueue()
void stack_linkedList::enqueue |
( |
int | ele | ) |
|
Definition at line 20 of file queue_using_linkedlist.cpp.
20 {
22 temp->data = ele;
23 temp->next = NULL;
24
25 if (front == NULL)
26 front = rear = temp;
27 else {
28 rear->next = temp;
29 rear = temp;
30 }
31}
◆ front
◆ rear
The documentation for this class was generated from the following file: