Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

101)a two part circular linked chain implementation of a queue A. All other answ

ID: 3868769 • Letter: 1

Question

101)a two part circular linked chain implementation of a queue

A. All other answers

B.keep nodes that are deallocated for future use

C. Allocates newnode on demand when there are no available nodes

D.is intialized with ni available nodes

102)In an array based implementationof a queue a possible solution to dealing with the full condition is to

A. All other answers

B. Check for frontIndex equal to backIndex

C.wait for an arrayFullException to be thrown

D. Maintain a count of queue items

103)In a linked chain implementation of a queue, the performance of the enqueue operation

A. O(1)

B.O(n)

C.O(logn)

D.O(n2)

104)In the linked chain implementation of a queue the chains first node contains

A. Both of the answers

B. The queues back entry

C. None of the other answers

D. The queue front entry

105)if we use a chajn of linked nodes with only a heard references to implement a queue which statement is true?

A. You must traverse the entire chain to access the last node

B. Boyh if the answers

C. Accessing the last node is very inefficient

D. None of the other amswers

106)In a circular array based implementation if a queue what is the performance when the enqueue operation if you amortize the cost id resizing the array over all additions to the

A. O(1)

B.O(n)

C.O(logn)

D.O(n2)

107)When a linke chain contain nodes that reference both the next node and the previous node it is called a(n)

A. Two way linked chain

B. Multi linked chain

C. Ordinary chain

D. Doubly linked chain

108)A linked chain whose last node is full is sometiems called an

A.linear linked chain

B.null terminated linked chajn

C.circular linked chain

D. All other amswers

109)when removing a node from a two part circular linked chain implementation of a queue

A. All other answers

B. The node is moved to the part of the chain that is available for the enqueue method

C. Entry at the front of the queue is returned

D.the queue node is advanced

110)In a doubly linked chain implementation of a queue, what is the performance when the dequeue operation

A. O(1)

B.O(n)

C.O(logn)

D.O(n2)

98)What item is at the front of the list after these statements are executed?

DequeInterface<String> waitingLine= new LinkedDeque<>();

WaitingLine.addToFront("Jack");

WaitingLine.addToFront("Rudy");

WaitingLine.addToBack("Larry");

WaitingLine.addToBack("sam");

String name =waitingLine.getFront();

A.sam B. Larry. C. Rudy. D. Jack

97)The java class library interface queue method to put an entey on the back of a queue that returns false if the method falls is

A. Add

B.put

C.poll

D.offer

94)The java class library interface queue method tagg retrieves the entey at the front of a queue but themrows a NosuchElementException if the queue was empty is

A.poke

B.empty

C.look

D.peek

93)when a counter enumerates simulated time units. It is called a(n)

A. All other amswers

B.time driven simulation

C.event drivem simulation

D.clock simulation
91)what item is at the front of the list after these statements are executed?

DequeInterface<String> waitingLine= new LinkedDeque<>();

WaitingLine.addToFront("Jack");

WaitingLine.addTolBack("Rudy");

WaitingLine.addToBack("Larry");

WaitingLine.addTolFront("sam");

name =getBack();

WaitingLine.addtoBack("Adam");

A.sam B. Adam. C. Rudy. D. Jack E. all other answers

90)The radix sort

A. Treats array entries asif they were strings that have same length

B. Is not suitable as a general purpose sorting algorithm

C.restrcits the data that it sorts on

D. All other answera

89)Which of the following statements are true about quick sort

A. It can degrade into an O(n2) sort if the pivot selection scheme is bad

B. It doesnt require additional memory that merges sort does

C. All other answers

D.in practice it can be transfer than merge sort
83) after merging two arrays is complete you need to
A.copy the rest of the decond array elements to the temporary array
B.copy the original to temporary array
c.copy the merged array back to the original array
d. copy the rest of the first array elements to the temporary array
45)given the following infix expression which one of the following is the corresponding postfix expression (a+b)*(c-d)/(e+f)
a.none of the other answers
b.ab+cd-*ef+/
c.abcdef+*-/+
d.ab+cd-ef+*/
120) which method is not meaningfull for use on an empty list
a.getEntry
b.replace
c.all other answers
d.remove

Explanation / Answer

101)

A two-part circular linked chain implementation of a queue all other answers.

The correct option is A

Explanation: Thus, a two-part circular linked chain implementation of a queue keeps nodes that are deallocated for future use, allocates new node on demand when there are no available nodes and is initialized with ni available nodes.

102)

In array based implementation of a queue a possible solution to dealing with the full condition is to Check for frontIndex equal to backIndex.

The correct option is B)

Explanation: In array based implementation of a queue, the full condition can be tested by checking that frontIndex is equal to backIndex.

103)

In a linked chain implementation of a queue, the performance of the enqueue operation is O (1)

The correct option is A.

Explanation: In enqueue () operation, the change in pointers take place so, the time complexity is O (1).

104)

In the linked chain implementation of a queue the chains first node contains the queue’s front entry.

The correct option is D

Explanation: The first node of the chain in linked list has the queue’s front entry.

105)

In we use a chain of linked nodes with only a heard reference to implement a queue, the true statement is both of the answers.

The correct option is B.

Explanation: In a chain of linked list is used to implement a queue, then you must traverse the entire chain to access the last node and also accessing the last node is very inefficient.

106)

In a circular array based implementation of a queue the performance when the enqueue operation if you amortize the cost id resizing the array over all additions is O (1).

The correct option is A.

107)

When a linked chain contains nodes that reference both the next node and the previous node is called a doubly linked chain.

The correct option is D)

Explanation: In a doubly linked chain, the nodes reference both the next node and the previous node.

108)

A linked chain whose last node is full is sometimes called a circular linked chain.

The correct option is C.

109)

When removing a node from a two-part circular linked chain implementation of a queue the node is moved to the part of the chain that is available for the enqueue method.

The correct option is B

110)

In a doubly linked chain implementation of a queue, the performance when the dequeue operation is O (1)

The correct option is A.

Explanation: When there is dequeue operation in a doubly linked chain implementation of a queue, the performance is O (1).

98)

The item which is at the front of the list after these statements are executed is Rudy.

The correct option is C.

Explanation: In this list “Jack” is added in front, then “Rudy” is added before it. Then, “Larry” is added at the back followed by “Sam”.

97)

The java class library interface queue method to put an entry on the back of a queue that returns false if the method falls is put

The correct option is B.

Explanation: Put is the method which puts an entry on the back of a queue that returns false if the method falls.

94)

The java class library interface queue method that retrieves the entry at the front of a queue and throws a NosuchElement Exception if the queue was empty is peek

The correct option is D.

93)

When a counter enumerates simulated time units, it is called time driven simulation.

The correct option is B.

Explanation: In time driven simulation, the system state and simulation time is initialized and then simulation time is initialized until the simulation is not finished.

91)

What item which is at the front of the list after these statements are executed is Sam.

The correct option is A.

90)

The radix sort treats array entries as it they were strings that have same length.

The correct option is A.

Explanation: In radix sort, the array entries are treated as the strings of same length.

89)

The statements which are true about quick sort are all other answers.

The correct option is C.

Explanation: The time complexity of quick sort is O(n^2) if a wrong pivot selection is done. Also, no additional memory is required in quick sort like merge sort. The quicksort is not always faster than merge sort, as the size of the input data grows, the quick sort becomes slow.

83)

After merging two arrays is complete you need to copy the rest of second array elements to the temporary array.

The correct option is A.

45)

For the infix expression: (a + b) * (c-d)/ (e + f), the corresponding postfix expressions is ab+ cd-*e f+/

The correct option is b.

Explanation: When the infix expression is given as an input in the stack, the operands are pushed in the stack and as soon as the operator is pushed, the operands before that operator pop out in correct order of precedence and the postfix expression is generated.

120)

The method which is not meaningful for use on an empty list is all other answers.

The correct option is c.

Explanation: All the given methods: getEntry, replace, remove are not meaningful for use on an empty list.