subject

Suppose we have a Java class named CircularArrayQueue which uses a circular array to implement a Queue. Given the main method in the figure below, solve the following questions. public static void main(String args[]) { CircularArrayQueue numQueue = new CircularArrayQueue(); int i = 0; Scanner sc = new Scanner(System. in); do { int choice = Integer. parseInt(sc. next()); if (choice < 35) numQueue. enqueue (choice); i++; } while (i < 10); do { System. out. println("Dequeued from the Queue: } while (numQueue. isEmpty() == false); + numQueue. dequeue()); sc. close(); } (a) Suppose we input the following integers in the command line terminal: 4 5 67 89 21 3 0 76 34 12. What is the output of the main method?
(b) Describe the worst-case time complexity of the main method in Big-Oh notation. Use o (1) as complexities for enqueue, dequeue, and isEmpty methods of Queue operations and all other method calls.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
6. the is particularly susceptible to the effects of alcohol because it receives a large portion of total blood flow and has a high concentration of neurons. a. heart b. pancreas c. brain d. liver
Answers: 2
question
Computers and Technology, 22.06.2019 11:00
Which law requires employers to provide safe working environments for their employees? a. civil rights act b. fair labor standards act c. occupational safety and health act d. wagner act
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
Working on this program in python 3.7: a year in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: 1) the year must be divisible by 42) if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year.ex: if the input is 1712, the output is: 1712 is a leap year. ex: if the input is 1913, the output is: 1913 is not a leap year. your program must define and call the function isleapyear(useryear). the function should return true if the input year is a leap year and false otherwise.
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
You know the right answer?
Suppose we have a Java class named CircularArrayQueue which uses a circular array to implement a Que...
Questions
question
History, 19.11.2020 20:10
question
Mathematics, 19.11.2020 20:10
question
Mathematics, 19.11.2020 20:10
question
Mathematics, 19.11.2020 20:10
question
Chemistry, 19.11.2020 20:10