#calculating O time complexity of a program
1 messages · Page 1 of 1 (latest)
Hey, @signal turtle!
Please remember to /close this post once your question has been answered!
i guess i will provide some example code:
public class Area {
public static void main(String[] args) {
int width = 7, height = 4;
int area = width * height;
if (area <= 0)
System.out.println(“area invalid”);
else if (area > 35)
System.out.println(“area to big”);
else
System.out.println(“area just right”);
}
}```
i dont think this is a very good example
but how would I calculate big O time complexity of it
calculate it yourself
Just reduce the program to a polynomial function that describes the number of computations required per each additional input.
wow thanks for the help big rat 😍