Week 3 Discussion Forum

What is a brute force algorithm?

What is a brute force algorithm?

by Masud Parvez Pyiash 192-15-2827 -
Number of replies: 0

A brute force algorithm is a rather straightforward approach to solving a problem. It is based on trial and error where the programmer tries to merely utilize the computer’s fast processing power to solve a problem, rather than applying some advanced algorithms and techniques developed with human intelligence. It is a naive approach adopted by most beginner programmers in the initial stages of solving a problem, however it might not be the most optimal approach, as it might increase both space and time complexity.

A simple example of applying brute force would be linearly searching for an element in an array. When each and every element of an array is compared with the data to be searched, it might be termed as a brute force approach, as it is the most direct and simple way one could think of searching the given data in the array. However, there are better ways to search data which make use of more optimum algorithms like binary search, etc. which adopt a more innovative way to solve the same problem.

176 words