Flag this Question Question 1 2 pts A test driver for the ba

Flag this Question Question 1 2 pts A test driver for the bad add method should check for which one of the following

Flag this Question Question 2 2 pts

1.      Measuring the growth of an algorithm\'s time requirement grows as the problem size increases is called the

Flag this Question Question 3 2 pts Which behaviors do not change the contents of a bag?

Flag this Question Question 4 2 pts Which behaviors change the contents of a bag?

Flag this Question Question 5 2 pts

1.       Which one of the following is considered a safe and secure programming practice?

Flag this Question Question 6 2 pts Which behavior is NOT represented in a bag?

Flag this Question Question 7 2 pts

1.      In a node object, the next field contains

Flag this Question Question 8 2 pts

1.       Which one of the following is considered a safe and secure programming practice?

Flag this Question Question 9 2 pts What happens when you use the new operator in the LinkedBag constructor?

Flag this Question Question 10 2 pts What happens if an OutOfMemoryError occurs while adding a new node to the chain?

Flag this Question Question 11 2 pts

1.      Which of the following operations could be identified as the basic operation of an algorithm?

Question 12 2 pts An incomplete definition of a method is called a _____.


Flag this Question Question 13 2 pts What is an advantage of using a chain for a Bag ADT?


Flag this Question Question 14 2 pts

1.       What are the consequences of returning a reference to the bag array in the toArray method?


Flag this Question Question 15 2 pts

1.      The most significant contributor to an algorithm\'s time requirement is


Flag this Question Question 16 2 pts

1.      When removing a node from a chain, what case should we consider?


Flag this Question Question 17 2 pts

1.      The memory required to run an algorithm is called


Flag this Question Question 18 2 pts Which of the following is NOT true with regard to bags?


Flag this Question Question 19 2 pts A program\'s execution time depends in part on


Flag this Question Question 20 2 pts

1.      An object you link in Java to form a linked list is called a(n)

//JUST POST ANSWWERS ASA

printing elements of the bag

Solution

Answer 1

A test driver for the bad add method should check for an over capacity condition

So, correct option is an over capacity condition

Answer 2

Measuring the growth of an algorithm’s time requirement grows as the problem size increases is called the time complexity.

So, the correct option is time complexity.

Answer 3

The behaviors that do not change the contents of a bag is none of the above.

Explanation: Each of the functions are responsible for changing the contents of a bag.

remove () removes an element from the bag.

add () adds an element in the bag.

clear () clears the content of the bag.

So, the correct option is none of the above.

Answer 4

The behaviors that change the contents of the bag are all of the above.

Explanation: Each of the functions are responsible for changing the contents of a bag.

remove () removes an element from the bag.

add () adds an element in the bag.

clear () clears the content of the bag.

So, the correct option is all of the above.

Answer 5

A safe and secured programming practice will be validating input data and arguments to a method.

The correct option is validating input data and arguments to a method.

Answer 6

The behavior which is NOT represented in a bag is reorder the bag.

Explanation: The function to reorder the bag is not contained in the bag. Hence, this behavior is not represented through a bag.

The correct option is reorder the bag.

Answer 7

In a node object, the next field contains a reference to another node.

The correct option is a reference to another node

Answer 8

The safe and secure programming practice is using @SupressWarning(“unchecked”)

The correct option is using @SuppressWarning(“unchecked”)

Answer 9

When you use the new operator in the Linked Bag constructor a new node is created, the JRE allocates memory for a node object and a new object is instantiated.

The correct option is all of the above.

Answer 10

If an OutOfMemoryError occurs while adding a new node to the chain, the chain will remain intact.

The correct option is that the chain will remain intact.

Answer 11

The operations that could be identified as the basic operation of an algorithm are addition, multiplication and division.

So, the correct option is all of the above.

Answer 12

An incomplete definition of a method is called a stub.

The correct option is stub.

Answer 13

The advantage of using a chain for a Bag ADT is that it avoids moving data when adding or removing bag entries.

The correct option is that it avoids moving data when adding or removing bag entries.

Explanation: When data is linked, the data organization avoids the movement of data when adding or removing bag entries.

Answer 14

The consequences of returning a reference to the bag array in the toArray method are:

the return variable is an alias for the private instance array variable

the client will have direct access to the private instance array variable

the client could change the contents of the private instance array variable without using the public access methods.

So, the correct option is all of the above.

Explanation: when a reference is returned, the right is given to access the object. So, the client will have direct access to private variables and the contents can be changed accordingly.

Answer 15

The most significant contributor to an algorithm’s time requirement is the algorithm’s basic operation.

So, the correct option is the algorithm’s basic operation

Answer 16

When removing a node from a chain, the cases that we should consider are when the node is at the end of the chain and when the node is at the beginning of the chain.

The correct option is both a and b

Answer 17

The memory required to run an algorithm is called space complexity.

The correct option is space complexity.

Explanation: The space complexity refers to the extra auxiliary space needed to perform the algorithm.

Answer 18

The statement which is not true with regard to bags is that the objects are in a specific order.

So, the correct option is that the objects are in a specific order.

Answer 19

A program’s execution time depends in part on the memory capacity.

The correct option is the memory capacity.

Answer 20

An object you link in Java to form a linked list is called a reference

The correct option is reference.

Flag this Question Question 1 2 pts A test driver for the bad add method should check for which one of the following Flag this Question Question 2 2 pts 1. Meas
Flag this Question Question 1 2 pts A test driver for the bad add method should check for which one of the following Flag this Question Question 2 2 pts 1. Meas
Flag this Question Question 1 2 pts A test driver for the bad add method should check for which one of the following Flag this Question Question 2 2 pts 1. Meas
Flag this Question Question 1 2 pts A test driver for the bad add method should check for which one of the following Flag this Question Question 2 2 pts 1. Meas

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site