It doesn't care about such things as your operating system, programming language, hardware. It's merely to suggest that if you double the data size, does the time taken also double (O(n)), or quadruple (O(n*n)).

You can't compute the complexity of a program by inspecting the source code with another program.

i am working a project and i need help.... i need to create a program that can read c++ and java code to compute their time complexity..... i have been suggested to use java as a PL... my problem is i don't know how to get started, i'm thinking of computing the complexity by batch in the codes. what do you think?

It is impossible to make a program that can compute the time complexity of any program. But you _could_ compute the time complexity for some trivial algorithms. You need to tell us on what subset of the set of programs you want to support computing time complexity.

Complexity is determined from examining algorithms, not implementations.

Bubble sort is O(N*N) no matter how you choose to implement it.

Nor is complexity computable either, for that would be tantamount to also solving the halting problem as well. It is an asymptotic estimate of the upper bound of the performance of the algorithm.

Inline Code Example Here
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n = 0;
double x,sn=0,snm1 =1,tn=1,tnm1=1,diff;
cout << "Enter a value x which is ...

You are going to build a simulator for a Bakery Business. The bakery sells up to 10 different items, and has a different number of each item at the start ...