Заглавная страница Избранные статьи Случайная статья Познавательные статьи Новые добавления Обратная связь FAQ Написать работу КАТЕГОРИИ: АрхеологияБиология Генетика География Информатика История Логика Маркетинг Математика Менеджмент Механика Педагогика Религия Социология Технологии Физика Философия Финансы Химия Экология ТОП 10 на сайте Приготовление дезинфицирующих растворов различной концентрацииТехника нижней прямой подачи мяча. Франко-прусская война (причины и последствия) Организация работы процедурного кабинета Смысловое и механическое запоминание, их место и роль в усвоении знаний Коммуникативные барьеры и пути их преодоления Обработка изделий медицинского назначения многократного применения Образцы текста публицистического стиля Четыре типа изменения баланса Задачи с ответами для Всероссийской олимпиады по праву Мы поможем в написании ваших работ! ЗНАЕТЕ ЛИ ВЫ?
Влияние общества на человека
Приготовление дезинфицирующих растворов различной концентрации Практические работы по географии для 6 класса Организация работы процедурного кабинета Изменения в неживой природе осенью Уборка процедурного кабинета Сольфеджио. Все правила по сольфеджио Балочные системы. Определение реакций опор и моментов защемления |
Consider the following statement using the STL sort() routine.↑ Стр 1 из 3Следующая ⇒ Содержание книги
Поиск на нашем сайте
Consider the following statement using the STL sort() routine. sort(A.begin(), A.end(), f); Which of the following most accurately describes the result of executing this statement? Consider a data set of 100 items. Which of the following is a search algorithm (are search algorithms) that could possibly examine 25 items in this set before succeeding? Linear search (a) I only Consider the following C++ code fragment. for(int i = 0; i < n; i++) { If body executes in constant time, then the asymptotic running time that most closely bounds from above the performance of this code fragment is Consider the following definition of a recursive function f. bool f(int x) The value returned by the call f(x) will determine whether the input x is Consider the following C++ function that uses a divide and conquer approach to calculate the sum of a range of numbers. int sum(int i, int j) { int power(int b, int e) Asymptotically in terms of the exponent e, the number of calls to power that occur as a result of the call power(b,e) is for(int i = 0; i < n; i += 2) { If body executes in constant time, then the asymptotic running time that most closely bounds from above the performance of this code fragment is for(int i = 0; i < n; i += 2) { If body executes in constant time, then the asymptotic running time that most closely bounds from above the performance of this code fragment is for(int i = 1; i < n; i *= 2) body; If body executes in O(1) time, then the asymptotic running time that most closely bounds the code fragment above is Consider the following code fragment. for(int i = n; i > 0; i /= 2) body; If body executes in O(1) time, then the asymptotic running time that most closely bounds the fragment is template<class T> void sort(T a[], int n) {... } For a given sorting algorithm S, which of the following is true about using this outline to implement S? template<typename A, typename B> template<typename T> void swap(T& a, T& b){ swap(i1, c2) try { template<typename T> class Array {... } template<typename T> void swap(T& a, T& b){ class Base { public: int x; private: int y; }; class Derived: public Base { public: int z; }; Derived D; Under these declarations, which of the following statements, if any, will fail to compile? (c) D.y = 555;
Consider the following partial C++ template class definition. template<typename T> class Array { public: T& operator[](int i) {return arr[i];}... private: int len; T *arr; }; Which of the following is a (are) correct template instantiation(s)? I.Array<int> A; II.Array<double> A; III.Array<Array<int> > A; (d) I, II, and III Consider the following template swap function and data types. template<typename T> void swap(T& a, T& b){ T tmp = a; a = b; b = tmp; } char c1, c2; int i1, i2; float A[10]; Which of the following calls to swap produces a compile time error? I.swap(i1, c2) II.swap(c1, i2); III.swap(A[5], A[2]); (b) I and II deque<int> numbers; vector<int> A(10); int f(int x) For which inputs x will the call f(x) terminate? vector<int> A(10,20); int f(int n) The value returned by the call f(10); is int ff(int n) If n > 0, what is returned by ff(n)? Consider the following definition of a recursive function ff in C++. int ff(int n, int m) class string { vector<Thing> A(10); string str1("Hello, World"); stack<int,vector<int> > S; Execution of the statement results in creation of which of the following? list<int> A(10,20); Which of the following accurately describes what is created? Insert element with value 3 The next element removed from this queue will have which of the following values? list<int>::iterator it; The code segment will not serve the intended purpose because Consider the following C++ program segment, which uses the STL. stack<int> X; for(it = L.begin(); it!= L.end(); ++it) Execution of this fragment has the effect of D Decomposition of a problem involves which of the following? queue provides support for iterators, whereas deque does not.
E
Each of the following is a basic C++ type except
F
it--; In a template definition template<typename T>...
L Lines at a store, file cabinets, and bookcases are real-world entities that most resemble _____ in computer science.
Consider the following statement using the STL sort() routine. sort(A.begin(), A.end(), f); Which of the following most accurately describes the result of executing this statement?
|
||||
Последнее изменение этой страницы: 2016-04-07; просмотров: 464; Нарушение авторского права страницы; Мы поможем в написании вашей работы! infopedia.su Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав. Обратная связь - 52.14.48.138 (0.007 с.) |