Filters
Question type

Study Flashcards

The index-based function get returns the i th element of a given list.

A) True
B) False

Correct Answer

verifed

verified

True

A list is a concrete data structure with a specific and unvarying implementation based on a single block of physical memory.

A) True
B) False

Correct Answer

verifed

verified

Unlike a simple iterator, a list iterator supports movement to previous positions, directly to the first position, and directly to the last position.

A) True
B) False

Correct Answer

verifed

verified

What are the values of a list index at the head and tail of the list, respectively?


A) 0, n-1
B) 1, n
C) 0, n
D) n-1, 1

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

Correct Answer

verifed

verified

A

How does position-based operations allow the programmer to navigate through a list?


A) by incrementing the head pointer
B) by decrementing the tail pointer
C) by moving the cursor
D) by changing the backing store

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

Correct Answer

verifed

verified

Recursive list processing became one of the building blocks of a movement in software development called abstract programming.

A) True
B) False

Correct Answer

verifed

verified

Which of the following is true about lists?


A) items must be sorted
B) items must be physically contiguous
C) the order of items is unimportant
D) items are logically contiguous

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

Correct Answer

verifed

verified

In the implementation of the lister iterator on a doubly linked list, the method hasNext returns False if the cursor is less than the backing store's length.

A) True
B) False

Correct Answer

verifed

verified

Initially, when a list iterator is opened on a non-empty list, the cursor's position is immediately after the first item in the list.

A) True
B) False

Correct Answer

verifed

verified

Why can you refer to an item in a list via its relative position from the head of the list using an index?


A) because it has a circular structure
B) because it uses round-robin
C) because it is ordered linearly
D) because it's arranged in a hierarchy

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

Correct Answer

verifed

verified

The list method remove(item) is an example of a content-based operation.

A) True
B) False

Correct Answer

verifed

verified

Which structure is the ideal one to support a list iterator?


A) array
B) circular array
C) doubly linked
D) singly linked

E) None of the above
F) All of the above

Correct Answer

verifed

verified

There are two broad categories of list operations discussed in most textbooks on data structures: index-based and content-based.

A) True
B) False

Correct Answer

verifed

verified

The __init__ method of a doubly linked list creates a node with no data.

A) True
B) False

Correct Answer

verifed

verified

With respect to memory, what happens when an object is no longer needed?


A) the garbage collector returns the object's space to the free list
B) the disk block is marked as unused
C) the size of the array holding the object is reduced by 1
D) the data block is marked as deleted and is unavailable to other objects

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

Correct Answer

verifed

verified

A disk's surface is divided into concentric tracks, and each track is further subdivided into sectors.

A) True
B) False

Correct Answer

verifed

verified

A traversal with a list iterator begins by moving the cursor to the first position or to the last position.

A) True
B) False

Correct Answer

verifed

verified

A list iterator is an object attached to a list that provides positional operations on that list.

A) True
B) False

Correct Answer

verifed

verified

When the first method is run on the list iterator, what happens?


A) the cursor is reset to 0
B) the list is cleared
C) the cursor is set to -1
D) the list is instantiated

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

Correct Answer

verifed

verified

The basic building block of a doubly linked structure is a node with two pointers: head, which points left; and tail, which points right.

A) True
B) False

Correct Answer

verifed

verified

False

Showing 1 - 20 of 50

Related Exams

Show Answer