Filters
Question type

Study Flashcards

Which of the following exceptions can be thrown if an object cannot be instantiated?


A) IllegalAccessException
B) ArithmeticException
C) IndexOutOfBoundsException
D) NoSuchMethodException

E) None of the above
F) B) and D)

Correct Answer

verifed

verified

What information is stored in a reference to an object?

Correct Answer

verifed

verified

A reference to an ob...

View Answer

Which of the following statements deletes the node that curr references?


A) prev.setNext(curr) ;
B) curr.setNext(prev) ;
C) curr.setNext(curr.getNext() ) ;
D) prev.setNext(curr.getNext() ) ;

E) All of the above
F) A) and D)

Correct Answer

verifed

verified

Which of the following statements deletes the first node of a linear linked list that has 10 nodes?


A) head.setNext(curr.getNext() ) ;
B) prev.setNext(curr.getNext() ) ;
C) head = head.getNext() ;
D) head = null;

E) A) and C)
F) B) and C)

Correct Answer

verifed

verified

A ______ can be used to store global information about a linked list.


A) head record
B) tail reference
C) precede reference
D) dummy head node

E) C) and D)
F) None of the above

Correct Answer

verifed

verified

If the implementation of a linked list maintains information about only one node,the head of the list,how is it able to be a collection of more than one node? In other words,how can we have a linked list of 20 nodes,if the list implementation only stores information about the head node?

Correct Answer

verifed

verified

The nodes are all linked to ea...

View Answer

What is a dummy head node?

Correct Answer

verifed

verified

A dummy head node is a first n...

View Answer

If a linked list is empty,the statement head.getNext() will throw a(n) ______.


A) IllegalAccessException
B) ArithmeticException
C) IndexOutOfBoundsException
D) NullPointerException

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

The ADT list can have an arbitrary length.

A) True
B) False

Correct Answer

verifed

verified

In all circular linked lists,______.


A) every node references a predecessor
B) every node references a successor
C) the next reference of the last node has the value null
D) each node references both its predecessor and its successor

E) C) and D)
F) A) and B)

Correct Answer

verifed

verified

In the following code segment: final int SIZE = 20;// line 1 Int groupSize;// line 2 GroupSize = SIZE;// line 3 GroupSize = groupSize * 2;// line 4 What is the value of groupSize in line 2?


A) 0
B) null
C) 20
D) 40

E) B) and C)
F) All of the above

Correct Answer

verifed

verified

Which of the following CANNOT be used in a linear linked list?


A) a head node
B) a dummy head node
C) a precede reference
D) a tail reference

E) A) and B)
F) A) and D)

Correct Answer

verifed

verified

A dummy head node ______.


A) facilitates adding nodes at the end the linked list
B) is used to store the first item in the linked list
C) is the second node in the linked list
D) is always present,even when the linked list is empty

E) B) and D)
F) A) and B)

Correct Answer

verifed

verified

According to the principle of information hiding,the data fields of a class must be declared as ______.


A) public
B) protected
C) private
D) abstract

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

Name two advantages of implementing the ADT list as an array instead of using a linked list (reference based).

Correct Answer

verifed

verified

Finding a value does...

View Answer

Which of the following is true about all doubly linked lists?


A) each node references both its predecessor and its successor
B) the precede reference of the last node has the value null
C) the last node references the first node
D) the precede reference of the first node references the last node

E) C) and D)
F) A) and B)

Correct Answer

verifed

verified

In Java,when is an object marked for garbage collection?

Correct Answer

verifed

verified

In Java,an object is...

View Answer

Each node in a linear linked list references both its predecessor and its successor.

A) True
B) False

Correct Answer

verifed

verified

A ______ allows the deletion of a node from a linked list without the need to traverse the list to establish a trailing reference.


A) head record
B) dummy head node
C) tail reference
D) precede reference

E) A) and C)
F) B) and D)

Correct Answer

verifed

verified

What is the difference between a linear linked list and a circular linked list?

Correct Answer

verifed

verified

In a circular linked list,the next porti...

View Answer

Showing 41 - 60 of 60

Related Exams

Show Answer