...\source\repos\solution_finalDSA\finalDSA\finalDSA.
cpp 1
1 #include <iostream>
2 using namespace std;
3 struct node {
4 int info;
5 node* next;
6 };
7 struct queue {
8 node* head;
9 node* tail;
10 };
11 void khoitaoQueue(queue& q) {
12 [Link] = [Link] = NULL;
13 }
14 node* createnode(int x) {
15 node* p = new node;
16 if (p == NULL) exit(1);
17 p->info = x;
18 p->next = NULL;
19 return p;
20 }
21 bool isEmpty(queue q) {
22 return [Link] == NULL;
23 }
24 void push(queue& q, node* p) {
25 if ([Link] == NULL) [Link] = [Link] = p;
26 else {
27 [Link]->next = p;
28 [Link] = p;
29 }
30 }