3 3 3 3 def change_maker (my_coins, my_money): output = [] i = 0 j = len(my_coins) while i < j: div = my_money // my_coins[i] my_money (my_coins[i] * div) output.append(div) i += 1 return output def main(): | print(change_maker ([25, 10, 5, 1], 121))
Hi, could you tell me the big O notation for this fuction please?
Introduction
Big O notation:
Big O notation is a mathematical notation used to describe the upper bound of the growth rate of the running time of an algorithm, with respect to the size of the input. It is a way to describe the efficiency of an algorithm by giving an estimate of the maximum number of operations it takes to solve a problem.
Big O notation provides a high-level view of the performance of an algorithm, independent of the specific details of the computer architecture and programming language used to implement the algorithm. This allows for easy comparison of the performance of different algorithms and helps to identify the most efficient solution for a given problem.
The most commonly used big O notations are O(1), O(log n), O(n), O(n log n), O(n^2), and O(2^n), where n is the size of the input. These notations describe the upper bound of the running time of an algorithm, from the fastest (O(1)) to the slowest (O(2^n)).
Trending now
This is a popular solution!
Step by step
Solved in 2 steps