I want queue implementation using linked list with Classes
By the way Nice work
|
Newbie Member
|
|
| 9Dec2009,14:29 | #11 |
|
Newbie Member
|
|
| 14Mar2012,11:57 | #12 |
|
This code has an error. If the list empties all of the way then rear doesn't point to null when it should. The delete function should be:
Code:
void qdelete(node **front,node **rear)
{
node *delnode; /* Node to be deleted */
if((*front)==NULL && (*rear)==NULL)
printf("\nQueue is empty to delete any element\n");
else
{
delnode=*front;
(*front)=(*front)->next;
if((*front) == NULL)
(*rear) = NULL;
free(delnode);
}
}
|
