Question
which of the following algorithms is correct for INSERTING AN ELEMENT AT THE RIGHT SIDE OF THE DE-QUEUE Select one: a. 1. Input the DATA
which of the following algorithms is correct for INSERTING AN ELEMENT AT THE RIGHT SIDE OF THE DE-QUEUE
Select one:
a. 1. Input the DATA to be inserted 2. If ((left == 0 && right == MAX1) || (left == right + 1)) (a) Display Queue Overflow (b) Exit 3. If (left == 1) (a) left = 0 (b) right = 0 4. Else (a) if (right == 0) (i) left = MAX 1 (b) else (i) right = right+1 5. Q[right] = DATA 6. Exit
b. 1. Input the DATA to be inserted 2. If ((left == 0 && right == MAX1) ) (a) Display Queue Overflow (b) Exit 3. If (left == 1) (a) left = 0 (b) right = 0 4. Else (a) if (right == MAX 1) (i) left = 0 (b) else (i) right = right+1 5. Q[right] = DATA 6. Exit
c. 1. Input the DATA to be inserted 2. If ((left == 0 && right == MAX1) || (left == right + 1)) (a) Display Queue Overflow (b) Exit 3. If (left == 1) (a) left = 0 (b) right = 0 4. Else (a) if (right == MAX 1) (i) left = 0 (b) else (i) right = right+1 5. Q[right] = DATA 6. Exit
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started