Exam 14: An Introduction to Data Structures

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

In an empty list, head is null.

(True/False)
4.8/5
(44)

We can only have a sorted linked list of basic data types.

(True/False)
4.9/5
(39)

If we know in advance the maximum number of items we will have in a queue, then we can use an array to represent the queue.

(True/False)
4.8/5
(33)

In a linked list representing a queue, what extra instance variable is desirable to have and why?

(Essay)
4.9/5
(44)

Unlike a linked list, an array has a fixed size, so the array could be completely filled with elements of the stack.

(True/False)
4.7/5
(36)

In a stack represented by a linked list, we push at the beginning of the list.

(True/False)
4.7/5
(44)

When we attempt to delete an item from a list but it is not on the list, the method returns void.

(True/False)
4.9/5
(40)

Consider a queue represented by an array of 10 elements and front and back, the two instance variables representing the indexes of the front and the back of the queue, respectively. If the value of front is 8 and the value of back is 7, what can you tell about the queue?

(Multiple Choice)
4.8/5
(31)

If we know in advance the maximum number of items we will have in a stack, then we can use an array to represent the stack.

(True/False)
4.9/5
(39)

Assuming a linked list is properly coded, attempting to delete from an empty list should not result in a NullPointerException.

(True/False)
4.8/5
(34)

When we delete the first node in a list, we always set head to null.

(True/False)
4.7/5
(36)

A queue is never empty.

(True/False)
4.8/5
(30)

What is the instance variable representing a reference to the first node in the linked-list class called?

(Multiple Choice)
4.9/5
(31)

In a queue represented by a linked list, we delete, or dequeue, based on the value of the item stored in a node.

(True/False)
4.8/5
(45)

In a sorted linked list, we insert in such a way that the list is still sorted after the insertion.

(True/False)
4.8/5
(35)

In a LIFO approach, the push method is used to delete the last item inserted.

(True/False)
4.8/5
(35)

Evaluate what is wrong with the following code, and recommend an alternative code. while ( current.getData( ) != value && current != null )

(Essay)
4.8/5
(36)

If the linked list is empty, deleting an item in a linked list representing a queue would result in a NullPointerException at run time.

(True/False)
4.8/5
(35)

A stack is never empty.

(True/False)
4.7/5
(30)

In a stack represented by a linked list, we delete based on the value of the item stored in a node.

(True/False)
4.8/5
(33)
Showing 21 - 40 of 69
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)