Update Queue Using Linked List.cpp

This commit is contained in:
Yang Libin 2019-08-21 09:17:20 +08:00 committed by GitHub
parent 0ab4f5f89d
commit abc0d365de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}