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
write a c++ program to find out the area of a curve y=f(x) between x=a and x=b

Using stacks, write an algorithm to determine whether the infix expression has balanced parenthesis or not Algorithm parseparens This algorithm reads a source program and

Q. Develop a representation for a list where insertions and deletions can be done at either end. Such a structure is known as a Deque (Double ended queue). Write functions for inse

how to draw a 5 inch square on the screen using * symbol

Question 1 What do you mean by Amortization? Question 2 Explain the following Big Oh notation (O) Omega notation (Ω) Theta notation (Θ)   Question 3 Di

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

Determine about the logic gates Many electronic circuits operate using binary logic gates. Logic gates essentially process signals that represent true or false or equivalent i.

write an algorithm to insert an element at the beginning of a circular linked list?

Prim's algorithm employs the concept of sets. Rather than processing the graph by sorted order of edges, this algorithm processes the edges within the graph randomly by building up

By taking an appropriate example explain how a general tree can be represented as a Binary Tree.                                                                    C onversio