Establish how many times statement x = 2* x is executed in the asymptotic sense:
j = n; x = 1;
while ( j >= 1 ) {
for ( i = 1; i <= 2*n; i++ )
x = 2 * x;
j = j / 2;
}
Given the following three statements:
I. n(n+1)/2 belongs to O(n)
II. n(n+1)/2 belongs to Theta(n)
III. n(n+1)/2 belongs to Omega(n)
I, II, and III are respectively
What is a tree?
Let G=(V,E) be a graph. Let |V|=n and |E|=e. What is the complexity of BFS (breadth first search) as a function of n and e?
Which of the following is a correct ordering, from best to worst of algorithm speeds?
Arrange the following in increasing order of growth:
n!, n3, 2n, n2, n, log n, n log n
Establish how many times statement x = 2* x is executed in the asymptotic sense:
j = n; x = 1;
while ( j >= 1 ) {
for ( i = 1; i <= 2*n; i++ )
x = 2 * x;
j = j / 2;
}
nlog( n ) + n^2 = Theta( n^2 + sqrt(n) )