Computer scienceAlgorithms and Data StructuresIntro to algorithms and data structuresUnderstanding algorithms and complexity analysis

Comparing algorithms with big O

Find max

Report a typo

Suppose you have a task to find the maximum number in a matrix (a table of numbers). You have a table of size nn (rows) by mm (columns), and you store nmn*m numbers in it. You take the first number as the maximum one. Then you traverse all other numbers, and when a larger value is found, it becomes the new maximum.

n x m matrix

What is the time complexity of such an algorithm?

Select one option from the list
___

Create a free account to access the full topic