Unlock access to all the studying documents.
View Full Document
Copyright Cengage Learning. Powered by Cognero.
1. All of the values in a list have the same type.
2. The size of a list is fixed and cannot be increased or decreased.
3. The sequential search algorithm does not assume that the list is sorted.
4. In a bubble sort, the smaller elements move toward the bottom, and the larger elements move toward the top of the list.
Copyright Cengage Learning. Powered by Cognero.
5. The bubble sort makes fewer item assignments than comparisons.
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.
7. The insertion sort algorithm sorts the list by moving each element to its proper place.
8. During the sorting phase of insertion sort, the array containing the list is divided into two sublists, sorted and unsorted.
Copyright Cengage Learning. Powered by Cognero.
28. The statement ____ creates the vector object vecList of size size.
vector[elemType] vecList(size);
vector<elemType> vecList(size);
vector(size) vecList<elementType>
vector{elemType::size} vecList;
29. A variable declared using the vector type is called a ____.
30. The statement ____ returns the element at the position index in vector vecList.
Copyright Cengage Learning. Powered by Cognero.
38. The type vector provides the function ____________________, which deletes all elements from the object.
39. The type vector provides the expression ____________________, which returns the last element of the object.
40. The type vector provides the expression ____________________, which inserts a copy of elem into vecList at
the end.
push_back(elem)
push_back
41. The type vector provides the expression ____________________, which deletes the last element of vecList.
42. The type vector provides the expression ____________________, which returns true if the object vecList is
empty and false otherwise.