Google Ads

Sunday, September 13, 2009

Queues using Arrays

Queues using Arrays


Algorithm


Step 1: Create a function Enqueue() with two arguments

Step 2: Assign the new element in the array by increasing the Rear variable.

Step 3: Create a function Dequeue with two arguments

Step 4: Increment the Front variable by 1.

Step 5: Create a function Isempty with no arguments

Step 6: Check whether the front pointer and rear is equal to zero.

Step 7: If true, the queue is empty otherwise not empty.

Step 8: Create a function Isfull to check whether the queue is full or not.

Step 10 : Stop the execution.

No comments:

Post a Comment