1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
1, the static queue must be why the circular queue 2, queue requires several cycles to determine the parameters required to determine the two parameters two parameters have different meanings in different situations font and rear meaning of each parameter 3, circular queue 1), initializing the queue font values are zero and the rear 2), a non-empty queue font represents the first element of the queue rear represents a valid last queue element 3), the queue empty font and rear equal, but not necessarily zero 4 cyclic pseudo algorithm team team included two steps 1), the value represented by the stored position r 2), the correct wording: r = (r + 1) the length of the array% error written: r = r + 1 . 5 , the dummy cycle team lists team algorithm f = (f + 1)% the length of the array 6, how to determine the circular queue is empty if the front and rear of equal value, i.e., the queue is empty f = r 7, how to determine the circular queue has full two ways: 1, more than the increase of a table identification parameter 2, less commonly an element with a second embodiment] [ 1), if the value of f r and next, it indicates that the queue is full 2), and c indicates the language pseudo algorithm is: IF ((R & lt +. 1)% array length == f) {at full} the else {} dissatisfied
|