subject
Mathematics, 04.04.2020 14:33 shayleewright

Rear = rear+1%n;where n = size of queue. The modulus returns the remainder of both of the operands (2 of them). For example, 4%2=0 since 4/2=2 with no remainder, while 4%3=1 since 4/3=1 with remainder 1. Since you can never have a remainder higher than the right operand, you have an effective "range" of answers for any modulus of 0 to (n-1). With that in mind, you can just plug in the numbers for each variable ((4+1)%5=? and (1+1)%4=?). Using long division you would then find the remainder. Therefore, the boundary condition achieved is when at the given position there is already an element that is present hence it will break the loop and element would not be enqueued until the position is free.

ansver
Answers: 2

Another question on Mathematics

question
Mathematics, 21.06.2019 19:30
When 142 is added to a number the result is 64 more times the number my options are 35 37 39 41
Answers: 1
question
Mathematics, 21.06.2019 20:00
Landon wrote that 3−2.6=4. which statement about his answer is true?
Answers: 1
question
Mathematics, 21.06.2019 20:30
If a 36 inch yardstick casts a 21 foot shadow, how tall is a building whose shadow is 168 feet? what is the scale factor
Answers: 1
question
Mathematics, 21.06.2019 21:30
Lizette is training for a marathon. at 7: 00 she left her house and ran until 8: 30, then she walked until 11: 30. she covered a total distance of 18 miles. her running speed was six miles per hour faster than her walking speed. find her running and walking speeds in miles per hour.
Answers: 2
You know the right answer?
Rear = rear+1%n;where n = size of queue. The modulus returns the remainder of both of the operands (...
Questions
question
Mathematics, 27.06.2019 04:00
Questions on the website: 13722360