Queue: Consider the following mechanism to handle the wraparound for front. Do they all work? If so, what do you think of them as implementations?

```
a. front = ( front == capacity ) ? 0 : front++;
b. front = front++ % capacity;
```

a. This will work, and is more elegant than the first method originally presented in the chapter.
b. This method will not work because the increment expression will be evaluated, and then front will be incremented.

Computer Science & Information Technology

You might also like to view...

When saving a workbook to the Web, you click your ________ account in the Save As pane

A) SkyDrive B) Facebook C) iCloud Storage D) Google Cloud Storage

Computer Science & Information Technology

Which of the following statements is false?

a. Lists are mutable—their elements can be modified. b. You can insert and delete list elements, changing the list’s length. c. Python’s string and tuple sequences are immutable—they cannot be modified. d. You can get the individual characters in a string, and you can assign a new value to one of the string’s characters.

Computer Science & Information Technology