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
Complexity classes All decision problems fall in sets of comparable complexity, called as complexity classes. The complexity class P is the set of decision problems which ca

Binary search technique:-  This technique is applied to an ordered list where elements are arranged either in ascending order or descending order. The array is separated into t

Q. Define a sparse matrix. Explain different types of sparse matrices? Show how a triangular array is stored in memory. Evaluate the method to calculate address of any element ajk

How to construct a data flow diagram for a college assignment and marking systemA

Q. Explain w hat are the stacks? How can we use the stacks  to check whether an expression is correctly parentheses or not. For example (()) is well formed but (() or )()( is not w

Simulation of queues: Simulation is the process of forming an abstract model of a real world situation in order to understand the effect of modifications and the effect of introdu

Q. Write down an algorithm to sort a given list by making use of Quick sort method. Describe the behaviour of Quick sort when input given to us is already sorted.

Binary search tree. A binary search tree is a binary tree that is either empty or in which every node having a key that satisfies the following conditions: - All keys (if an

Queue is a linear data structure utilized in several applications of computer science. Such as people stand in a queue to get a specific service, several processes will wait in a q

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