Question
Question 1 3 pts (TCO 4) Which of the following functions grows at a slower rate than the rest? n 2 n log n n
Question 13 pts
(TCO 4) Which of the following functions grows at a slower rate than the rest?
n2 |
n |
log n |
n3 |
Flag this Question
Question 23 pts
(TCO 4) Algorithms can be described using
pseudo-code. |
assignment and arithmetic operations. |
loops and decision statements. |
All of the above |
Flag this Question
Question 33 pts
(TCO 4) The running time of an algorithm is
the time, in milliseconds, it takes to complete its execution. |
the running time of its implementation. |
the maximum number of basic operations executed by the algorithm (over all inputs of size N). |
the number of steps given in its description. |
Flag this Question
Question 43 pts
(TCO 4) The following function returns the _____ of the array elements. int mystery(int a[], int n) { int x=a[0]; for (int i=1; i
maximum |
minimum |
middle element |
sum |
Flag this Question
Question 53 pts
(TCO 4) Consider the recursive function below. int RecFunction(int n) { if (n==0) return 0; else return RecFunction(n-1) + n; } What is the output in the statement cout << RecFunction(3); ?
2 |
4 |
6 |
8 |
Flag this Question
Question 63 pts
(TCO 4) Consider the function below. long x(int n) { if (n == 1) return 1; else return n*x(n-1); } What will be displayed by the cout statement cout << x(3) << endl; ?
720 |
25 |
6 |
1 |
Flag this Question
Question 73 pts
(TCO 4) The running time of bubble sort is _____.
O(n log n) |
O(log n) |
O(n) |
O(n2) |
Flag this Question
Question 83 pts
(TCO 4) A method that performs very well in practice, even though its worst-case running time is quadratic, is _____.
bubble sort |
insertion sort |
mergesort |
quicksort |
Flag this Question
Question 93 pts
(TCO 4) The running time of an algorithm to find the maximum of a collection of n numbers stored in an array is
O(n2). |
O(n log n). |
O(n). |
O(1). |
Flag this Question
Question 103 pts
(TCO 8) In C++ STL, use the function _____ to obtain an iterator pointing to the smallest value of the elements in a given range.
sort |
min_element |
max_element |
lower_bound |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started