Added caveat about brute force algorithms (#28079)
This commit is contained in:
committed by
Randell Dawson
parent
772f4e1c40
commit
3055dfc912
@ -14,6 +14,8 @@ Some more examples of brute force algorithms are:
|
|||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
Generally, brute force approaches should be avoided for more optimal algorithms, especially when the functions using these algorithms will scale to larger and larger numbers. The difference between brute force and optimized algorithms may not be immediately apparent when dealing with smaller numbers and lesser chunks of time, but the difference between a brute-force O(n^3) algorithm and an optimized O(nlog(n)) algorithm becomes very apparent for problems of larger scales.
|
||||||
|
|
||||||
#### More Information:
|
#### More Information:
|
||||||
|
|
||||||
<a href="https://en.wikipedia.org/wiki/Brute-force_search"> Wikipedia </a>
|
<a href="https://en.wikipedia.org/wiki/Brute-force_search"> Wikipedia </a>
|
||||||
|
Reference in New Issue
Block a user