Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
O(1) You have a constant input size so it is hard to say anything is more than O(1). You process only 2 matrices and the matrices are always 2 by 2. Even though you have loops, those iterate only constant iterations. In other words, there is no "n" to relate the execution time to.
14th Feb 2020, 6:37 PM
Josh Greig
Josh Greig - avatar