Can anyone explain the time complexity of this code ??



2/13/2020 4:58:24 PM

Subhankar Ghosh

1 Answer

New Answer


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.