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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 09:30, Cocco
You have been supporting csm tech publishing's windows server 2016 server network for over a year. the office has two windows server 2016 servers running active directory and a number of other roles. management has informed you that a small sales office is opening in the same building three floors up. the sales manager wants to install a sales application on a server located in the sales office. this server will have limited physical security because there's no special room dedicated for it, which means it will be accessible to non-it personnel and visitors. you're considering installing windows server 2016 server core on the new server because accessing its console regularly probably won't be necessary, and this server will be managed from one of the other csm tech publishing servers. what are the benefits and drawbacks of using server core for this branch office? what are some things you should do to set up this server management environment?
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, jhitotw
What is the primary difference between the header section of a document and the body? a. the body is displayed on the webpage and the header is not. b. the header is displayed on the webpage and the body is not. c. the tag for the body is self-closing, but the tags for the headers must be closed. d. the tag for the header is self closing, but the tag for the body must be closed.
Answers: 3
image
Computers and Technology, 24.06.2019 12:50, neptunesx
Write a new lc-3 trap subroutine (i. e. a subroutine that will be invoked via the trap instruction) that will receive a numeric digit entered at the keyboard (i. e. an ascii character), echo it to the screen, and return in r0 the corresponding numeric value: so if the user types the digit '7', the character '7' will appear on the screen, but the value returned in r0 will be b0000 0000 0000 0111 (#7) you may not use any trap calls in your code - you must implement the "polling" code that interrogates the keyboard status and data registers. ; getnum_tsr ; a subroutine for obtaining a numeric value ; given ascii numeric digit input to keyboard. ; the numeric digit is echoed to the console (e. g. '7' = b0000 0000 0011 0111), ; but the value returned in r0 is the actual numeric value ; corresponding to the digit (e. g. b0000 0000 0000 0111 =
Answers: 3
image
Computers and Technology, 24.06.2019 17:30, mjmckay03
What is the main difference between cloud computing and saas? cloud computing is a platform, and saas is software. cloud computing is software, and saas is a platform. cloud computing is a service, and saas is software. cloud computing is a service, and saas is a platform.
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 in other subjects:

Konu
Physics, 10.12.2019 04:31