mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-08 13:06:57 +08:00
Merge pull request #286 from omkarkolate/patch-2
Update in Deque() fuction
This commit is contained in:
@@ -35,7 +35,7 @@ void Enque(int x)
|
||||
|
||||
void Deque()
|
||||
{
|
||||
if (rear==front)
|
||||
if (rear == NULL && front == NULL)
|
||||
{
|
||||
cout<<"\nUnderflow";
|
||||
}
|
||||
@@ -45,6 +45,8 @@ void Deque()
|
||||
cout<<"\n"<<t->val<<" deleted";
|
||||
front=front->next;
|
||||
delete t;
|
||||
if(front == NULL)
|
||||
rear = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user