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
Q. Illustrate the result of running BFS and DFS on the directed graph given below using vertex 3 as source.  Show the status of the data structure used at each and every stage.

Suppose there are exactly five packet switches (Figure 4) between a sending host and a receiving host connected by a virtual circuit line (shown as dotted line in figure 4). The tr


1. Start 2. Get h 3. If h T=288.15+(h*-0.0065) 4. else if h T=216.65 5. else if h T=216.65+(h*0.001) 6. else if h T=228.65+(h*0.0028) 7. else if h T=270.65 8.

Q. Define a method for keeping two stacks within a single linear array S in such a way that neither stack overflows until entire array is used and a whole stack is never shifted to

what is circular doubly link list?write down the algorithm for insertion of elements in circular doubly link list

Develop a program that accepts the car registration( hint: LEA 43242010)

merging 4 sorted files containing 50 10 25 and 15 records will take time

Area Subdivision Method In this method, the viewport is examined for clear decisions on the polygons situated in it, in regard to their overlap and visibility to the viewer. Fo

Q. What is the need of using asymptotic notation in the study of algorithm? Describe the commonly used asymptotic notations and also give their significance.