Exam 2: An Overview of Collections

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

A search operation is usually more efficient on a sorted collection than on an unsorted collection.

(True/False)
4.8/5
(46)

What is the value of newList after the following code executes? NewList = list(range(9, 0, -3))

(Multiple Choice)
4.8/5
(36)

A line of customers waiting to get into a movie is an example of a hierarchical collection.

(True/False)
4.9/5
(35)

Which real-world item best represents a linear collection?

(Multiple Choice)
4.8/5
(36)

In which type of collection does each item have many predecessors and successors, called neighbors?

(Multiple Choice)
4.7/5
(34)

In computer science, collections are also called objective data types (ODTs).

(True/False)
4.7/5
(39)

What is the value of newObject after the following code executes? NewObject = tuple("Hello")

(Multiple Choice)
4.8/5
(36)

What is the value of r after the following code executes? MyList = [ 2, 3, 5, 7, 11 ] YourList = list(myList) R = yourList is myList

(Multiple Choice)
4.8/5
(46)

To determine equality of two collections, use the == operator.

(True/False)
4.7/5
(45)

By default, items in a sorted collection are visited in descending order when using a for loop iterator.

(True/False)
4.8/5
(30)

Which of the following lists Python units of abstraction from smallest to largest?

(Multiple Choice)
4.8/5
(47)

In computer science, abstraction is used for ignoring or hiding details that are nonessential.

(True/False)
4.8/5
(39)

What is the value of r after the following code executes? MySet = {2, 3, 5, 7, 11} YourSet = {5, 7, 2, 11, 3} R = yourSet == mySet

(Multiple Choice)
4.9/5
(34)

All collections are also iterable objects.

(True/False)
4.8/5
(26)

To be considered equal, two lists must have the same length and the same items in each position, whereas the same sets must simply contain exactly the same items, but in no particular order.

(True/False)
4.8/5
(37)

The pop method is used to add items to a Python list.

(True/False)
4.8/5
(42)

When a shallow copy of a collection is made, only references to the items in the new collection are copied.

(True/False)
4.8/5
(49)

Graph collections are organized in a parent/children relationship.

(True/False)
4.7/5
(36)

To traverse a collection's items, use the for loop.

(True/False)
4.8/5
(34)

What can a programmer do to prevent side effects from cloning mutable objects?

(Multiple Choice)
4.9/5
(35)
Showing 21 - 40 of 50
close modal

Filters

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