Determine the complexity, Data Structure & Algorithms

1)    The set of the algorithms whose order is O (1) would run in the identical time.  True/False

2)    Determine the complexity of the following program into big O notation:

printMultiplicationTable(int max){

for(int i = 1 ; i <= max ; i + +)

{

for(int j = 1 ; j <= max ; j + +) cout << (i * j) << " " ; cout << endl ;

}  //for

3)   Assume the following program segment:

for (i = 1; i <= n; i *= 2)

{

j = 1;

}

Find out running time of the above program segment into big O notation?

 

4)   Prove that if f(n) = n2 + 2n + 5 and g(n) = n2 then f(n) = O (g(n)).

5)   How several times does the given for loop will run

for (i=1; i<= n; i*2)

k = k + 1;

end;

Posted Date: 4/4/2013 6:08:14 AM | Location : United States







Related Discussions:- Determine the complexity, Assignment Help, Ask Question on Determine the complexity, Get Answer, Expert's Help, Determine the complexity Discussions

Write discussion on Determine the complexity
Your posts are moderated
Related Questions
(1)  (i) Add the special form let to the metacircular interpreter Hint: remember let is just syntactic sugar for a lambda expression and so a rewrite to the lambda form is all t

The advantage of list over Arrays is flexibility. Over flood is not a problem until the computer memory is bushed. When the individual record are quite large, it may be difficult t

Q. Give the algorithm for the selection sort. Describe the behaviours of selection sort when the input given is already sorted.

Write a program for reversing the Linked list

WRITE AN ALGORITHM TO READ TWO NUMBERS AND PRINT THE LOWER VALUE

In this unit, we described about the data structure Queue. It had two ends. One is front from where the elements can be removed and the other is rear where the elements can be inse

What is Algorithm A finite sequence of steps for accomplishing some computational task. An algorithm should Have steps which are simple and definite enough to be done

What is called the basic operation of an algorithm? The most significant operation of the algorithm is the operation contributing the most to the total running time is known as

Warnock's Algorithm A divide and conquer algorithm Warnock (PolyList PL, ViewPort VP) If (PL simple in VP) then Draw PL in VP, else Split VP vertically and horiz

how to creat atm project by using linked list?