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 20:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
Answers: 3
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Lakendra finished working on her monthly report. in looking it over, she saw that it had large blocks of white space. what steps could lakendra take to reduce the amount of white space?
Answers: 3
You know the right answer?
Suppose we have a Java class named CircularArrayQueue which uses a circular array to implement a Que...
Questions
Questions on the website: 13722367