Big-O notation gives an approximate measure of an algorithms computing time:
A -
for a large number of inputs
B -
for any machine used
C -
All of the others answers
D -
for various language used
2-
Based on the following code segment:
#
Cout<< newNum;The output of the this segment is (all variables are of type int)?
A -
7580
B -
758
C -
857
D -
8570
3-
char *ptGrade; which is the data type in this declaration?
A -
The data type in this is Char
B -
int
C -
long int
D -
All of the above
4-
Consider the following code:
void negate (int& x) {
x = -1 * x;
}
What would happen during a call "negate(&y);" in main?
(y is an integer variable.)
A -
x is negated, y is not
B -
y is negated, x is not
C -
This code will not correctly compile
D -
Both x and y are negateed
5-
Consider the following code:
void negate (int x) {
x = -1 * x;
}
What would happen during a call "negate(&y);" in main?
(y is an integer variable.)
A -
x is negated, y is not
B -
This code will not correctly compile
C -
Both x and y are negateed
D -
y is negated, x is not
6-
Consider the following code:{
void negate (int& x) {{
x = -1 * x;{
}{
What would happen during a call "negate(&y);" in main?{
(y is an integer variable.)
A -
y is negated, x is not
B -
Both x and y are negateed
C -
This code will not correctly compile
D -
x is negated, y is not
7-
Consider the following code given{
typedef int *intptr;{
intptr p, q r;{
p = new int;{
q = new int;{
*p = 10;{
*q := 15;{
r = p;{
p = q;{
q = r;{
Value of * p after run this segment is
A -
15
B -
5
C -
10
D -
11
8-
Consider the following two program segments.
//SEGMENT 1
#
A -
2.6
B -
3.3
C -
3.1
D -
3.6
9-
Consider the following code given
Typedef int *intptr;
#
The output would be
A -
15 10
B -
15 15
C -
10 15
D -
10 10
10-
Consider the following functions of n:
(i) n^2 + log n;
(ii) n^2 log n;
(iii) 1 + 2 + … + 2n;
(iv) log (n!).
Which one of the following function is not O(n^2)?