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
Determine in brief the Painter Algorithm a) The farthest polygon, namely the rectangle PQRS, is stored first. (b) The next farthest, the quadrilateral ABCD, is superpo

Data array A has data series from 1,000,000 to 1 with step size 1, which is in perfect decreasing order. Data array B has data series from 1 to 1,000,000, which is in random order.

how do we use 4-discs stack to solve tower of hanoi problem and write an algorithm to solve it?

Huffman Encoding is one of the very simple algorithms to compress data. Even though it is very old and simple , it is still widely used (eg : in few stages of JPEG, MPEG etc). In t

Construct a B+ tree for the following keys, starting with an empty tree.  Each node in the tree can hold a maximum of 2 entries (i.e., order d = 1). Start with an empty root nod

The  total  of  time  needed  by  an algorithm to run to its completion is termed as time complexity. The asymptotic running time of an algorithm is given in terms of functions. Th

explain collision resloving techniques in hasing

Question 1 Discuss the following theorems with respect to Splay Trees- Balance Theorem Dynamic Finger Theorem   Question 2 Write a C program for implementation

The following are several operations on a AA-tree: 1. Searching: Searching is done using an algorithm which is similar to the search algorithm of a binary search tree. 2. Ins

(a) Explain the term Group Support System and elaborate on how it can improve groupwork. (b) Briefly explain three advantages of simulation. (c) Explain with the help of a