تلخيص
تلخيص
case
Bubble sort O(n) O(n2) O(n2)
Selection sort O(n2) O(n2) O(n2)
Insertion sort O(n) O(n2) O(n2)
Merge sort O(n logn) O(n logn) O(n logn)
Quick sort O(n logn) O(n logn) O(n2)
The worst-case time complexity of Quick Sort is________.
A. O(n2)
B. O(log n)
C. O(n)
d. O(n logn)
a) O(V + E)
b) O(V)
c) O(E)
d) O(V*E)
The Data structure used in standard implementation of Breadth First
Search is?
a) Stack
b) Queue
c) Linked List
d) Tree
A) TRUE
B) FALSE
THIS diagram is AVL tree property?
A)TRUE
B) FALSE
A)TRUE
B) FALSE
A)TRUE
B) FALSE
THIS diagram is AVL tree property?
THIS diagram is AVL tree property?
A)TRUE
B)FALSE
1- For the following program gives Big O analysis of the running time.
For (i=0; i<n*n*n; i++)
A[i] = i+2;
a) O(n)
b) O(n2)
c) O(log n)
d) O(n3)
For the following program gives Big O analysis of the running time.
For (i=0; i< n; i++)
For (j=i; j< n; j++)
For (k=j; k< n; k=k/2)
S++;
a) O(n-1)
b) O(n2)
c) O(n3)
d) O(n2 log n)
- For each of the following functions, indicate the class Θ(g(n)) the function
belongs to n(n + 1) / 2
g(n)=.................................
A. linear
B. Quadratic
C. cubic
D. factorial
13- For each of the following functions, indicate the class Θ(g(n)) the function
belongs to 2000 n3 + 3/ 2
g(n)=.................................
A. linear
B. exponential
C. cubic
D. factorial
14- For each of the following functions, indicate the class Θ(g(n)) the function
n
belongs 150! +2 +50
g(n)=.................................
A. cubic
B. exponential
C. Constant
D. factorial
15- For each of the following functions, indicate the class Θ(g(n)) the function
belongs 5! + 2 log n +100
g(n)=.................................
A. logarithmic
B. exponential
C. Constant
D. factorial
16- For each of the following functions, indicate the class Θ(g(n)) the function
3
Belongs to 8! +2
g(n)=.................................
A. cubic
B. exponential
C. Constant
D. linear
n3 + 2n2+100 ∈ Θ(n2).
a) True
b) False
2n+ 5 n3 ∈ Ω(n!)
a) True
b) False
2n+ 5 n3 ∈ O(n!)
a) True
b) False
nlog n+ 5 n ∈ Ω(n+5)
a) True
b) False