what will be the algorithm to insert an element in queue without using tag
Answers
Answered by
2
MARK BRILLIANT
Answer:
How can we write an algorithm to add multiple elements say 5 elements {1,2,3,4,5} in an queue I searched a lot but found algorithm to insert only one item but I don't know how to run a loop to insert multiple elements. the algorithm to insert one item which I found is
Start
Check if the Queue is full or not if(rear=N-1) THEN print “Queue is Full” and exit else goto step 3
Increment the rear ++rear;
Add the item at the ‘rear’ position Q[rear]= item;
Exit
Explanation:
Answered by
1
Answer:
check if the queue is full or not if(rear=n-1)
then print "queue is full and exit else goto .
step no 3 .in step 3_
increment the rear ++rear;
add the item at the 'rear' position Q[rear]=item,
exit.
Hope its help you.
#BAL #Answerwithquality
Similar questions
English,
6 months ago
Social Sciences,
6 months ago
Hindi,
6 months ago
Biology,
1 year ago
Math,
1 year ago
Math,
1 year ago
World Languages,
1 year ago