![]() ![]() A linked list can also be used to implement a queue, but we must maintain both a head and a tail pointer because we need access to both the front and the rear of the queue. A queue is structured, as described above, as an ordered collection of items which are added at one end, called the rear, and removed from the other end, called the front.…by putting it at location 0 (if that location is not already used).In this example, suppose we want to add the number 4 to the queue. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |