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 10:00
Which of the following is true of operations within a spreadsheet program’s built-in functions? a. operations within parentheses, then multiplication and division, and then addition and subtraction are computed. b. operations within parentheses, then addition and subtraction, and then multiplication and division are computed. c. multiplication and division, then addition and subtraction, and then operations within parentheses are computed. d. addition and subtraction, then multiplication and division, and then operations within parentheses are computed
Answers: 2
question
Computers and Technology, 22.06.2019 11:50
You have written, as part of a school assignment, a research paper on the solar system. you want to share this paper on your school website. on which type of server will you upload it?
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
The best definition of an idiom is a. a word or phrase that describes a noun b. a word or phrase describing a verb c. a phrase containing figurative language in which the word expresses a different idea from its exact meaning d. a phrase that compares two unlike objects or ideas
Answers: 2
question
Computers and Technology, 24.06.2019 16:00
Which type of cloud computing offers easily accessible software and applications on the machines
Answers: 1
You know the right answer?
Suppose we have a Java class named CircularArrayQueue which uses a circular array to implement a Que...
Questions
question
Social Studies, 17.09.2019 14:00
question
Physics, 17.09.2019 14:00
Questions on the website: 13722363