Calculation of time complexity, Data Structure & Algorithms

Example: Assume the following of code:

x = 4y + 3 z = z + 1

p = 1

As we have been seen, x, y, z and p are all scalar variables & the running time is constant irrespective of the value of x,y,z and p. Here, we emphasize that each of line of code might take different time, to execute, however the bottom line is that they will take constant amount of time. Therefore, we will describe run time of each line of code as O(1).

Posted Date: 4/4/2013 6:19:06 AM | Location : United States







Related Discussions:- Calculation of time complexity, Assignment Help, Ask Question on Calculation of time complexity, Get Answer, Expert's Help, Calculation of time complexity Discussions

Write discussion on Calculation of time complexity
Your posts are moderated
Related Questions
Midsquare Method :- this operates in 2 steps. In the first step the square of the key value K is taken. In the 2nd step, the hash value is obtained by deleting digits from ends of

Q. A Binary tree comprises 9 nodes. The preorder and inorder traversals of the tree yield the given sequence of nodes: Inorder :          E     A    C    K    F     H    D

The best average behaviour is shown by  Quick Sort


Let G=(V,E) be a graph for which all nodes have degree 5 and where G is 5-edge is connected. a) Show that the vector x which is indexed by the edges E and for which xe = 1/5 for

Q. Write down an algorithm for finding a key from a sorted list using the binary search technique or method.

For AVL trees the deletion algorithm is a little more complicated as there are various extra steps involved in the deletion of node. If the node is not a leaf node, then it contain

how to define the size of array

Example of pre order traversal: Reading of a book, since we do not read next chapter unless we complete all sections of previous chapter & all its sections. Figure  : Rea

Q. What do you understand by the term by hash clash? Explain in detail any one method to resolve the hash collisions.