There are 2 buildings and on each’s window, a flower pot is kept. Ravi’s mother tells him to multiply each cell/window to the other and store in a matrix ? What would be time complexity if he writes a code to do so ?
C. Theta (n)
D. Theta (n2)
Answer : D. Theta(n2)
- The multiplication involved will use two for loops and hence the complexity will be Theta(n2)