Computer scienceAlgorithms and Data StructuresData structuresLimited access data types

Circular queue

Seems normal to me

Report a typo

Suppose your circular queue is in the following state:

Circular queue with empty start and end

For some reason, you have to perform the following operation: enqueue 7. In what position should the newly added 7 appear in the queue above?

If:

  • the circular queue cannot be in the state represented in the image, output 100
  • nothing happens after we perform the operation, output 10
  • an error occurs, output -1
  • the output depends on other factors and can't be determined, output -10.
Enter a number
___

Create a free account to access the full topic