Merge pull request #286 from omkarkolate/patch-2

Update in Deque() fuction
This commit is contained in:
Yang Libin
2019-08-21 09:16:36 +08:00
committed by GitHub

View File

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