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;


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
Representation of data structure in memory is known as: Abstract data type

: Write an algorithm to evaluate a postfix expression. Execute your algorithm using the following postfix expression as your input: a b + c d +*f ­ .

Q.  In the given figure find the shortest path from A to Z using Dijkstra's Algorithm.    Ans: 1.  P=φ;  T={A,B,C,D,E,F,G,H,I,J,K,L,M,Z} Let L(A)

give any example of page replacement using fifo and use your own reference string

The below figure illustrates the BOM (Bill of Materials) for product A. The MPS (Material requirements Planning) start row in the master production schedule for product A calls for

Can a Queue be shown by circular linked list with only single pointer pointing to the tail of the queue? Yes a Queue can be shown by a circular linked list with only single p

write an algorithm for multiplication of two sparse matrices using Linked Lists

Q. A linear array A is given with lower bound as 1. If address of A[25] is 375 and A[30] is 390, then find address of A[16].

Q. What do you understand by the term sparse matrix? How sparse matrix is stored in the memory of a computer? Write down the function to find out the transpose of a sparse matrix u

lower triangular matrix and upper triangular matrix