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
Colouring The use of colours in CAD/CAM has two main objectives : facilitate creating geometry and display images. Colours can be used in geometric construction. In this case,

Q. Explain the Hash Tables, Hash function and Hashing Techniques properly?             A n s . H as h Table is explained as follows : A hash table is a data struc

Explain class P problems Class  P  is  a  class  of  decision  problems  that  can  be  solved  in  polynomial time  by(deterministic) algorithms. This class of problems is kno


Problem 1. You are asked to store Names of all 100 students of class A in your Learning Centre. Which data type will you use? What is its syntax? Explaining the data typ

Binary Search Tree let three types of traversals by its nodes. They are: Pre Order Traversal In Order Traversal Post Order Traversal In Pre Order Traversal, we ca

A queue is a, FIFO (First In First Out) list.

A binary tree in which if all its levels except possibly the last, have the maximum number of nodes and all the nodes at the last level appear as far left as possible, is called as

What is a height balanced tree? Height Balanced Tree (AVL Tree) An AVL tree is a binary search tree in which the height of the left and right subtree of the root vary by at most

Representation of data structure in memory is known as: Abstract data type