java - Length of Specified Queue -


i correcting 1 of tests , incorrect on 1 question, many of others in class. suppose have declaration:

arraybndqueue<string> q = new arraybndqueue<string>(10); 

choose 1 of following describe length of queue.

  • a) length is
  • b) there not enough information compute length of queue
  • c) situation cannot happen

front = 8 rear = 7

we thought enough information queue. if front 8 , 7, thought full queue (of length 10). however, answer incorrect. can explain why, exactly?

queue collection , has size() method returns size. unknown how arraybndqueue implemented jdk queues empty after creation unless accept collection argument @ construction time.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -