After execution of the statement:
Char *p = "Stuff";
What would be printed by following statement?
printf ("%c", *p+2);
A -
uff
B -
tuff
C -
Suff
D -
ff
2-
After execution of the statement:
Char *p = "incoll4";
What would be printed by following statement?
printf ("%c", *p+3);
A -
inc
B -
II4
C -
k
D -
oII4
3-
After execution of the statement:
Char *p = "incoll4";
What would be printed by following statement?
printf ("%c", *p+2);
A -
c
B -
C
C -
n
D -
K
4-
An array is a way to reference a series of memory locations using the ____
A -
Multiple names
B -
Same name
C -
different name
D -
Unique name
5-
An Algorithm that:
Array is imaginary divided into two parts – sorted one and unsorted one. At the beginning, sorted
part is empty, while unsorted one containts whole array. At every step, algorithm finds minimal
element in the unsorted part and adds it to the end of the sorted one. When unsorted part
becomes empty, algorithm stops.
That is a (an) ____
A -
Quick sort
B -
Selection Sort
C -
Insertion Sort
D -
Bubble sort
6-
An Algorithm that:
1. Compare each pair of adjacent elements from the beginning of an array and, if they are in
reversed order, swap them.
2. If at least one swap has been done, repeat step 1
That is a (an) ____
A -
Selection Sort
B -
Bubble sort
C -
Insertion Sort
D -
Quick sort
7-
An Algorithm that: Array is imaginary divided into two parts – sorted one and unsorted one. At the beginning, sorted
part contains first element of the array and unsorted one contains the rest. At every, algorithm
takes first element in the unsorted part and inserts it to the right place of the sorted one. When
unsorted part becomes empty, algorithm stops.
That is a (an) ____
A -
Insertion Sort
B -
Quick sort
C -
Selection Sort
D -
Bubble sort
8-
An inorder traversal of this tree is:
A -
8 5 1 30 12 15 18 20 25 10 35
B -
8 5 1 30 12 18 20 25 10 35 15
C -
5 1 30 12 8 15 18 20 25 10 35
D -
8 5 1 12 15 18 20 30 25 10 35
9-
Arrange the following functions, often used to represent complexity of algorithms in
order from slowest to fastest
O(1), O(n), O(n*log2 n), O(log2 n), O(n^2), O(2^n)
A -
2^n n*log n n^2 n log n 1
B -
n*2 2^n n*log n n log n 1
C -
n*log 2^n n^2 n n log n 1
D -
2^n n^2 n*log n n log n 1
10-
Assume that Algorithm Test has a time complexity O(n^3), and that Algorithm Compute
has time complexity O(n^2). What is the time complexity of the following algorithm?
Execute Algorithm Test
For 5 trials, execute Algorithm Compute
Execute Algorithm Test