Deck 5: Sequential Containers

ملء الشاشة (f)
exit full mode
سؤال
A template class is a class that stores and processes a collection of information.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
If you remove an element from a vector object, the size automatically decreases.
سؤال
The for loop below is designed to populate an int type vector named my_vector with the first ten odd positive integers. Using the vector class at() function, complete the for loop.
for (int index = 0; index ++; index < 10)
__________
سؤال
When implementing a(n) __________ class, all of the code must be in the header or in a file included by the header.

A) derived
B) base
C) public
D) template
سؤال
Which of the following headers changes the subscript operator defined below so that it returns a non-modifiable reference?
<strong>Which of the following headers changes the subscript operator defined below so that it returns a non-modifiable reference?  </strong> A) const Item_Type& operator[](size_t index) B) const Item_Type& operator[](size_t index) const C) Item_Type& operator[](size_t index) const D) static Item_Type& operator[](size_t index) const <div style=padding-top: 35px>

A) const Item_Type& operator[](size_t index)
B) const Item_Type& operator[](size_t index) const
C) Item_Type& operator[](size_t index) const
D) static Item_Type& operator[](size_t index) const
سؤال
To insert an item into the middle of the array, the values that are at the __________ point and beyond must be shifted over to make room.

A) insertion
B) starting
C) mid
D) end
سؤال
Most of the user-defined operational expense in the KW::vector class reserve function is attributable to the for loop excerpted below.
<strong>Most of the user-defined operational expense in the KW::vector class reserve function is attributable to the for loop excerpted below.   Using order of growth techniques against this code fragment, we can estimate that each reallocation of reserve () is __________.</strong> A) O(1) B) O(n log<sub>2</sub>n) C) O(n) D) O(n<sup>2</sup>) <div style=padding-top: 35px>
Using order of growth techniques against this code fragment, we can estimate that each reallocation of reserve () is __________.

A) O(1)
B) O(n log2n)
C) O(n)
D) O(n2)
سؤال
Even if we have to reallocate in a call to KW::vector class insert (), the cost of the operation would still be O(__________).
سؤال
The purpose of the copy constructor is to create a shallow copy of an object.
سؤال
For class types, assignment is done by what is appropriately known as the __________ operator.
سؤال
The variable called "this" is a(n) __________ to the object to which a member function is applied.
سؤال
A(n) __________ list provides the ability to add or remove items anywhere in the list in constant (O(1)) time.
سؤال
A(n) __________ is a pointer to a node.

A) struct
B) node
C) link
D) item
سؤال
Provide a critical line of code that will enable the while loop below to terminate.
Provide a critical line of code that will enable the while loop below to terminate.  <div style=padding-top: 35px>
سؤال
You can create a __________ liked list by linking the last node to the first node (and the first node to the last one).

A) single
B) circular
C) double
D) reverse
سؤال
A(n) __________ is a moving place marker that can be advanced forward (using operator++) or backward (using operator--).
سؤال
In the context of iterators, a(n) __________ represents a common interface that a generic class must meet.
سؤال
What value is output after the final line in the following code segment executes?
<strong>What value is output after the final line in the following code segment executes?  </strong> A) -842150451 B) 0 C) 55 D) 89 <div style=padding-top: 35px>

A) -842150451
B) 0
C) 55
D) 89
سؤال
Which of the following conditions will enable this KW::list function to perform its task?
<strong>Which of the following conditions will enable this KW::list function to perform its task?  </strong> A) tail->next != NULL B) tail != NULL C) tail == NULL D) tail->next == NULL <div style=padding-top: 35px>

A) tail->next != NULL
B) tail != NULL
C) tail == NULL
D) tail->next == NULL
سؤال
Which line will properly complete the definition for KW::iterator class postfix increment operator?
Iterator operator++(int) {
Iterator return_value = *this;
__________
Return return_value;
}

A) this++
B) ++this
C) --(*this)
D) ++(*this)
سؤال
Because a list and a vector have several member functions in common, they may be used polymorphically.
سؤال
The associative containers are designed for fast retrieval of data based on a unique value stored in each item, called its __________.
سؤال
Provide the code that completes the definition of the STL template find function below.
Provide the code that completes the definition of the STL template find function below.  <div style=padding-top: 35px>
سؤال
The template functions, or __________perform fairly standard operations on containers, such as applying the same function to each element (for_each), copying values from one container to another (copy), searching a container for a target value (find, find_if), or sorting a container (sort).

A) algorithms
B) procedures
C) methods
D) routines
سؤال
The function call operator cannot be overloaded by a class.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/25
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 5: Sequential Containers
1
A template class is a class that stores and processes a collection of information.
True
2
If you remove an element from a vector object, the size automatically decreases.
True
3
The for loop below is designed to populate an int type vector named my_vector with the first ten odd positive integers. Using the vector class at() function, complete the for loop.
for (int index = 0; index ++; index < 10)
__________
my_vector.at(index) = 2 * index + 1;
4
When implementing a(n) __________ class, all of the code must be in the header or in a file included by the header.

A) derived
B) base
C) public
D) template
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which of the following headers changes the subscript operator defined below so that it returns a non-modifiable reference?
<strong>Which of the following headers changes the subscript operator defined below so that it returns a non-modifiable reference?  </strong> A) const Item_Type& operator[](size_t index) B) const Item_Type& operator[](size_t index) const C) Item_Type& operator[](size_t index) const D) static Item_Type& operator[](size_t index) const

A) const Item_Type& operator[](size_t index)
B) const Item_Type& operator[](size_t index) const
C) Item_Type& operator[](size_t index) const
D) static Item_Type& operator[](size_t index) const
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
6
To insert an item into the middle of the array, the values that are at the __________ point and beyond must be shifted over to make room.

A) insertion
B) starting
C) mid
D) end
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
7
Most of the user-defined operational expense in the KW::vector class reserve function is attributable to the for loop excerpted below.
<strong>Most of the user-defined operational expense in the KW::vector class reserve function is attributable to the for loop excerpted below.   Using order of growth techniques against this code fragment, we can estimate that each reallocation of reserve () is __________.</strong> A) O(1) B) O(n log<sub>2</sub>n) C) O(n) D) O(n<sup>2</sup>)
Using order of growth techniques against this code fragment, we can estimate that each reallocation of reserve () is __________.

A) O(1)
B) O(n log2n)
C) O(n)
D) O(n2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
8
Even if we have to reallocate in a call to KW::vector class insert (), the cost of the operation would still be O(__________).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
9
The purpose of the copy constructor is to create a shallow copy of an object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
10
For class types, assignment is done by what is appropriately known as the __________ operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
11
The variable called "this" is a(n) __________ to the object to which a member function is applied.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
12
A(n) __________ list provides the ability to add or remove items anywhere in the list in constant (O(1)) time.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
13
A(n) __________ is a pointer to a node.

A) struct
B) node
C) link
D) item
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
14
Provide a critical line of code that will enable the while loop below to terminate.
Provide a critical line of code that will enable the while loop below to terminate.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
15
You can create a __________ liked list by linking the last node to the first node (and the first node to the last one).

A) single
B) circular
C) double
D) reverse
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
16
A(n) __________ is a moving place marker that can be advanced forward (using operator++) or backward (using operator--).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
17
In the context of iterators, a(n) __________ represents a common interface that a generic class must meet.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
18
What value is output after the final line in the following code segment executes?
<strong>What value is output after the final line in the following code segment executes?  </strong> A) -842150451 B) 0 C) 55 D) 89

A) -842150451
B) 0
C) 55
D) 89
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which of the following conditions will enable this KW::list function to perform its task?
<strong>Which of the following conditions will enable this KW::list function to perform its task?  </strong> A) tail->next != NULL B) tail != NULL C) tail == NULL D) tail->next == NULL

A) tail->next != NULL
B) tail != NULL
C) tail == NULL
D) tail->next == NULL
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which line will properly complete the definition for KW::iterator class postfix increment operator?
Iterator operator++(int) {
Iterator return_value = *this;
__________
Return return_value;
}

A) this++
B) ++this
C) --(*this)
D) ++(*this)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
21
Because a list and a vector have several member functions in common, they may be used polymorphically.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
22
The associative containers are designed for fast retrieval of data based on a unique value stored in each item, called its __________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
23
Provide the code that completes the definition of the STL template find function below.
Provide the code that completes the definition of the STL template find function below.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
24
The template functions, or __________perform fairly standard operations on containers, such as applying the same function to each element (for_each), copying values from one container to another (copy), searching a container for a target value (find, find_if), or sorting a container (sort).

A) algorithms
B) procedures
C) methods
D) routines
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
25
The function call operator cannot be overloaded by a class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 25 في هذه المجموعة.