978-1337102087 Chapter 16

subject Type Homework Help
subject Pages 9
subject Words 1973
subject Authors D. S. Malik

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
Name:
Class:
Date:
Copyright Cengage Learning. Powered by Cognero.
Page 1
1. All of the values in a list have the same type.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
1070
QUESTION TYPE:
True / False
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
2. The size of a list is fixed and cannot be increased or decreased.
a.
True
b.
False
ANSWER:
False
POINTS:
1
REFERENCES:
1070
QUESTION TYPE:
True / False
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
3. The sequential search algorithm does not assume that the list is sorted.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
1071
QUESTION TYPE:
True / False
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
4. In a bubble sort, the smaller elements move toward the bottom, and the larger elements move toward the top of the list.
a.
True
b.
False
ANSWER:
False
POINTS:
1
REFERENCES:
1071
QUESTION TYPE:
True / False
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
page-pf2
Name:
Class:
Date:
Copyright Cengage Learning. Powered by Cognero.
Page 2
5. The bubble sort makes fewer item assignments than comparisons.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
1074-1075
QUESTION TYPE:
True / False
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
6. The performance of bubble sort can be improved if we stop the sorting process as soon as we find that, in an iteration,
no swapping of elements takes place.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
1075
QUESTION TYPE:
True / False
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
7. The insertion sort algorithm sorts the list by moving each element to its proper place.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
1075
QUESTION TYPE:
True / False
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
8. During the sorting phase of insertion sort, the array containing the list is divided into two sublists, sorted and unsorted.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
1077
QUESTION TYPE:
True / False
HAS VARIABLES:
False
page-pf3
Name:
Class:
Date:
page-pf4
Name:
Class:
Date:
page-pf5
Name:
Class:
Date:
page-pf6
Name:
Class:
Date:
page-pf7
Name:
Class:
Date:
page-pf8
Name:
Class:
Date:
Copyright Cengage Learning. Powered by Cognero.
Page 8
the loop.
a.
one
b.
two
c.
n-2
d.
n
ANSWER:
a
POINTS:
1
REFERENCES:
1081
QUESTION TYPE:
Multiple Choice
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
28. The statement ____ creates the vector object vecList of size size.
a.
vector[elemType] vecList(size);
b.
vector<elemType> vecList(size);
c.
vector(size) vecList<elementType>
d.
vector{elemType::size} vecList;
ANSWER:
b
POINTS:
1
REFERENCES:
1083
QUESTION TYPE:
Multiple Choice
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
29. A variable declared using the vector type is called a ____.
a.
vector element
b.
vector array
c.
vector list
d.
vector container
ANSWER:
d
POINTS:
1
REFERENCES:
1083
QUESTION TYPE:
Multiple Choice
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
30. The statement ____ returns the element at the position index in vector vecList.
a.
vecList[index]
b.
vecList.get(index)
c.
vecList.front(index)
d.
vecList<index>
ANSWER:
a
POINTS:
1
REFERENCES:
1084
QUESTION TYPE:
Multiple Choice
HAS VARIABLES:
False
page-pf9
Name:
Class:
Date:
page-pfa
Name:
Class:
Date:
page-pfb
Name:
Class:
Date:
Copyright Cengage Learning. Powered by Cognero.
Page 11
38. The type vector provides the function ____________________, which deletes all elements from the object.
ANSWER:
clear()
clear
POINTS:
1
REFERENCES:
1084
QUESTION TYPE:
Completion
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
39. The type vector provides the expression ____________________, which returns the last element of the object.
ANSWER:
back()
back
POINTS:
1
REFERENCES:
1084
QUESTION TYPE:
Completion
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
40. The type vector provides the expression ____________________, which inserts a copy of elem into vecList at
the end.
ANSWER:
push_back(elem)
push_back
POINTS:
1
REFERENCES:
1084
QUESTION TYPE:
Completion
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
41. The type vector provides the expression ____________________, which deletes the last element of vecList.
ANSWER:
pop_back()
pop_back
POINTS:
1
REFERENCES:
1084
QUESTION TYPE:
Completion
HAS VARIABLES:
False
DATE CREATED:
10/5/2016 1:43 PM
DATE MODIFIED:
10/5/2016 1:43 PM
42. The type vector provides the expression ____________________, which returns true if the object vecList is
empty and false otherwise.
ANSWER:
empty()
page-pfc
Name:
Class:
Date:
page-pfd
Name:
Class:
Date:

Trusted by Thousands of
Students

Here are what students say about us.

Copyright ©2022 All rights reserved. | CoursePaper is not sponsored or endorsed by any college or university.