You are on page 1of 16

aSkip to main content

Analysis of Algorithm(A)
You are logged in as Khan Muhammad (Log out)

o Profile

o
o
o
o
o
o Calendar
o Course search
o Site News
o Abasyn Main Page
Page path
Home
/ My courses
/ Department of Computing & Technology
/ Fall 2016
/ Analysis of Algorithm(A)
/ 31 October - 6 November
/ Quiz #1
Question 1
Not yet answered
Marked out of 4.00
Flag question

Question text
The following function finds the value of
m a[1];
for i 2 to n
if a[i] < m then m a[i];
Select one:
a. factorial

b. maximum number
c. square root
d. minimum number
e. Non of these

Question 2
Not yet answered
Marked out of 4.00
Flag question

Question text
The time complexity of the following function is
for (int i = 0; i < a.length; i++)
{ system.out.println(a[i]); }
Select one:
a. T(n)=n
b. T(n)=c
c. T(n)=n2
d. T(n)=n3
e. None of these

Question 3
Not yet answered
Marked out of 4.00
Flag question

Question text
The time complexity of the following function is
for (int i = 1; i < n; i *= 2) {
for (int j = 1; j < n; j++) {
count++;
}
}
Select one:
a. None of these
b. T(n)=(n)
c. T(n)=O(n log n)
d. T(n)=O(n2)
e. T(n)=(n log n)

Question 4
Not yet answered
Marked out of 4.00
Flag question

Question text
What is the value of count when n = 20?
for (j = 0; j < n; j++)
for (k = 0; k < j; k++){
count++;
}
Select one:
a. 20
b. 400
c. 210
d. None of these

e. 200

Question 5
Not yet answered
Marked out of 4.00
Flag question

Question text
The correct ordering of the following functions is
(n log n, n2, n, log n)
Select one:
a. log n, n, n2, n log n
b. log n, n, n log n, n2
c. log n, n2, n, n log n
d. n log n, n2, n, log n
e. None of these

Question 6
Not yet answered
Marked out of 4.00
Flag question

Question text
value of n log2 n =? When n = 210?What is the
Select one:
a. 10480

b. 210*2
c. 1048
d. 2048
e. None of these

Question 7
Not yet answered
Marked out of 4.00
Flag question

Question text
Determine which relationship is correct, when f(n) = log n2; g(n) = log n + 5
Select one:
a. f(n) = (g(n))
b. f(n) = (g(n))
c. None of these
d. f(n) = (g(n))
e. f(n) = (g(n))

Question 8
Not yet answered
Marked out of 4.00
Flag question

Question text
Determine which relationship is correct, when f(n) = log log n; g(n) = log n

Select one:
a. f(n) = (g(n))
b. f(n) = (g(n))
c. f(n) = (g(n))
d. f(n) = (g(n))
e. None of these

Question 9
Not yet answered
Marked out of 4.00
Flag question

Question text
Determine which relationship is correct, when f(n) = 10; g(n) = log 10
Select one:
a. f(n) = (g(n))
b. f(n) = (g(n))
c. f(n) = (g(n))
d. f(n) = (g(n))
e. None of these

Question 10
Not yet answered
Marked out of 4.00
Flag question

Question text
Determine which relationship is correct, when f(n) = n; g(n) = log n2
Select one:
a. f(n) = (g(n))
b. f(n) = (g(n))
c. None of these
d. f(n) = (g(n))
e. f(n) = (g(n))

Question 11
Not yet answered
Marked out of 4.00
Flag question

Question text
Determine which relationship is correct, when f(n) = 2n; g(n) = 3n
Select one:
a. f(n) = (g(n))
b. f(n) = (g(n))
c. None of these
d. f(n) = (g(n))
e. f(n) = (g(n))

Question 12
Not yet answered
Marked out of 4.00

Flag question

Question text
Determine which relationship is correct, when f(n) = n log n+n; g(n) = log n
Select one:
a. f(n) = (g(n))
b. None of these
c. f(n) = (g(n))
d. f(n) = (g(n))
e. f(n) = (g(n))

Next
Skip Quiz navigation

Quiz navigation
Question1This page Question2This page Question3This page Question4This page Question5This
page Question6This page Question7This page Question8This page Question9This page Question10This
page Question11This page Question12This
page Question13Question14Question15Question16Question17Question18Question19Question20Question21
Question22Question23Question24Question25
Finish attempt ...
Time left 0:38:44
You are logged in as Khan Muhammad (Log out)

FL16-CS304-CA

Contact: administrator@abasynuniv.edu.pk
Abasyn University Ring Road Peshawar

Skip to main content

Analysis of Algorithm(A)
You are logged in as Khan Muhammad (Log out)

o Profile

o
o
o
o
o
o Calendar
o Course search
o Site News
o Abasyn Main Page
Page path
Home
/ My courses
/ Department of Computing & Technology
/ Fall 2016
/ Analysis of Algorithm(A)
/ 31 October - 6 November
/ Quiz #1
Question 13
Not yet answered
Marked out of 4.00
Flag question

Question text
The Best Case time complexity of Insertion sort algorithm is
Select one:
a. B(n)=c1n2 + c2
b. B(n)=c1n3 + c2
c. B(n)=c1n + c2

d. B(n)=c1n4 + c2
e. None of these

Question 14
Not yet answered
Marked out of 4.00
Flag question

Question text
The Worst Case time complexity of Insertion sort algorithm is
Select one:
a. W(n)=c1n5 + c2n + c3
b. None of these
c. W(n)=c1n2 + c2n + c3
d. W(n)=c1n4 + c2n + c3
e. W(n)=c1n3 + c2n + c3

Question 15
Not yet answered
Marked out of 4.00
Flag question

Question text
The number of comparisons done in worst case in Insertion Sort are
Select one:
a. n/2

b. n
c. n2/2
d. None of these
e. n3/2

Question 16
Not yet answered
Marked out of 4.00
Flag question

Question text
The number of exchanges perfomed in worst case in Insertion Sort are
Select one:
a. n3/2
b. None of these
c. n
d. n/2
e. n2/2

Question 17
Not yet answered
Marked out of 4.00
Flag question

Question text
The Worst Case time complexity of Bubble sort algorithm is

Select one:
a. W(n) = n2/2 n/2
b. W(n) = n2/2 n/2
c. None of these
d. W(n) = n2/2 n2/2
e. W(n) = n3/2 n/2

Question 18
Not yet answered
Marked out of 4.00
Flag question

Question text
The number of comparisons performed in Selection Sort are
Select one:
a. n/2
b. n3/2
c. None of these
d. n2/2
e. n

Question 19
Not yet answered
Marked out of 4.00
Flag question

Question text
The number of exchanges done in Insertion Sort are
Select one:
a. n
b. n2/2
c. n3/2
d. None of these
e. n/2

Question 20
Not yet answered
Marked out of 4.00
Flag question

Question text
Two main measures for the efficiency of an algorithm are
Select one:
a. Time and space
b. Processor and memory
c. None of these
d. Complexity and capacity
e. Data and space

Question 21
Not yet answered
Marked out of 4.00

Flag question

Question text
The complexity of Binary search algorithm is
Select one:
a. O(n log n)
b. O(n2)
c. None of these
d. O(log n)
e. O(n)

Question 22
Not yet answered
Marked out of 4.00
Flag question

Question text
Which of the following is the slowest running time of sorting algorithm?
Select one:
a. O(n2)
b. None of these
c. O(n log n)
d. O(n)

e. O(n3)

Question 23
Not yet answered
Marked out of 4.00
Flag question

Question text
The solution of recurrence equation T(n) = T(n/2) + (1) is
Select one:
a. None of these
b. (n log n)
c. (1)
d. (log n)
e. (n)

Question 24
Not yet answered
Marked out of 4.00
Flag question

Question text
The solution of recurrence equation T(n) = 2T(n/2) + (n 2) is
Select one:
a. (1)
b. (n2)

c. (log n)
d. None of these

Question 25
Not yet answered
Marked out of 4.00
Flag question

Question text
The solution of recurrence equation T(n) = 3T(n/4) + (n 2) is
Select one:
a. (log n)
b. (n/4)
c. None of these
d. (n log n)
e. (n2)

Next
Skip Quiz navigation

Quiz navigation
Question1Question2Question3Question4Question5Question6Question7Question8Question9Question10Questi
on11Question12Question13This page Question14This page Question15This page Question16This
page Question17This page Question18This page Question19This page Question20This page Question21This
page Question22This page Question23This page Question24This page Question25This page
Finish attempt ...
Time left 0:24:38
You are logged in as Khan Muhammad (Log out)

FL16-CS304-CA

Contact: administrator@abasynuniv.edu.pk
Abasyn University Ring Road Peshawar

You might also like