I am learning to analyze the big O complexity of various problem sets.
I know the Big O of an if-else construct is O(1) but can't seem to figure it out for this one. Will it be O(N), where N is the no. of if statements, or will it be O(1)?
I am learning to analyze the big O complexity of various problem sets.
I know the Big O of an if-else construct is O(1) but can't seem to figure it out for this one. Will it be O(N), where N is the no. of if statements, or will it be O(1)?
Big O notation deals with algorithms as they scale based on the input size. In this example, there is no input n. No matter how large your problem size is, your code will execute in O(1) time.