add the text "O(n*m) time" (#25545)

This commit is contained in:
Lavinder Singh
2018-12-20 22:47:59 +05:30
committed by Aditya
parent 10957f405f
commit 430e04e3d3

View File

@ -12,7 +12,7 @@ Some more examples of brute force algorithms are:
- A 5-digit password, in the worst case scenario, would take 10<sup>5</sup> tries to crack.
- A brute-force algorithm to find the divisors of a natural number n would enumerate all integers from 1 to n, and check whether each of them divides n without remainder.
The time complexity of brute force is <b> O(n*m) </b>. So, if we were to search for a string of 'n' characters in a string of 'm' characters using brute force, it would take us n * m tries.
The time complexity of brute force is <b> O(n*m) </b>. So, if we were to search for a string of 'n' characters in a string of 'm' characters using brute force, it would take O(n*m) time.
#### More Information: