◆ stack_linkedList()
stack_linkedList::stack_linkedList |
( |
| ) |
|
|
inline |
15{ front = rear = NULL; }
◆ dequeue()
int stack_linkedList::dequeue |
( |
| ) |
|
32 {
34 int ele;
35 if (front == NULL)
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}
Definition queue_using_linkedlist.cpp:6
◆ display()
void stack_linkedList::display |
( |
| ) |
|
47 {
48 if (front == NULL)
50
51 else {
53 temp = front;
54 while (temp != NULL) {
56 temp = temp->next;
57 }
58 }
59}
◆ enqueue()
void stack_linkedList::enqueue |
( |
int | ele | ) |
|
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}
The documentation for this class was generated from the following file:
- data_structures/queue_using_linkedlist.cpp