Examlex

Solved

Example Code Ch 13-5

question 55

Multiple Choice

Example Code Ch 13-5
Consider the following operations on a queue data structure that stores int values:
Queue q = new Queue() ;
q.enqueue(3) ;
q.enqueue(5) ;
q.enqueue(9) ;
System.out.println(q.dequeue() ) ; // d1
q.enqueue(2) ;
q.enqueue(4) ;
System.out.println(q.dequeue() ) ; // d2
System.out.println(q.dequeue() ) ; // d3
q.enqueue(1) ;
q.enqueue(8) ;
-Refer to Example Code Ch 13-5: If we replace the System.out.println statements (denoted in comments as d1, d2 and d3) with the statement q.enqueue(q.dequeue() ) ; q would contain which order of int values after all instructions have executed?


Definitions:

Capital

Financial assets or the financial value of assets, such as funds held in deposit accounts, as well as the physical factors of production like buildings and machinery.

Turkmenistan

A country located in Central Asia, bordered by the Caspian Sea and largely covered by the Karakum Desert.

Prospective Memory

The element of memory that facilitates the remembering of actions or intentions scheduled for a forthcoming time.

Perform Actions

Executing or carrying out tasks or operations through physical or mental efforts.

Related Questions