| Article Index |
|---|
| CIRCULAR QUEUE IMPLEMENTATION USING LINKED LIST |
| SOURCE CODE |
| DOCUMENTATION |
| TEST CASE AND COMPATIBILITY |
| All Pages |
GOAL OF THE CODE:
To implement a circular queue using LINKED LIST.
VARIABLES USED:
FUNCTIONS USED:
-
FUNCTION
PURPOSE
createqueue()
Dynamically allocates memory for the queue.
displayq()
Displays the contents of the queue.
isempty()
Returns 1 if the queue is empty else returns 0.
insert()
Inserts elements into the queue.
delete()
Deletes elements from the queue.
front()
Returns the front most element of the queue.
frontdel()
Deletes the front most element and then returns the value pointed out by the front pointer.
IMPLEMENTAION:
-
Initially,the maximum no.of elements to be stored in the queue is obtained from the user.
-
A circular queue is created by dynamically allocating memory using createqueue() function.
-
Then, choices are provided to the user from which one can choose the operation to be performed.
-
A switch case is made use of in this code. Depending upon the choice entered by the user,the corresponding operations are performed.
-
After each operation,the display() function is called so that the user can better understand the implementation.
-
If the user enters a number that has not been specified in the cases, the default case is executed and the program terminates.
Initialization: Assign the address of the header node to the address part of the next node(also known as emptying the queue).




