mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
Update Queue Using Linked List.cpp
This commit is contained in:
parent
0ab4f5f89d
commit
abc0d365de
@ -7,10 +7,8 @@ struct node
|
||||
node *next;
|
||||
};
|
||||
|
||||
|
||||
node *front, *rear;
|
||||
|
||||
|
||||
void Enque(int x)
|
||||
{
|
||||
if (rear == NULL)
|
||||
@ -42,7 +40,8 @@ void Deque()
|
||||
else
|
||||
{
|
||||
node *t = front;
|
||||
cout<<"\n"<<t->val<<" deleted";
|
||||
cout << "\n"
|
||||
<< t->val << " deleted";
|
||||
front = front->next;
|
||||
delete t;
|
||||
if (front == NULL)
|
||||
@ -84,9 +83,7 @@ int main()
|
||||
{
|
||||
show();
|
||||
}
|
||||
}
|
||||
while(ch!=0);
|
||||
} while (ch != 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user