Algorithm selection
One of the best things about writing software is that there is no single solution to a problem. We are free to use a style that’s unique to us and to incorporate data structures, libraries, and algorithms as long as we obtain the correct results. This is a bit of an overstatement. We can write an algorithm in essentially infinite different ways and get the same results.
This programming flexibility can also be a detriment, as evidenced by low-performant algorithms. So, just because we can write algorithms with reckless abandon, it does not mean we should. We should be strategic in our algorithm selection and creation as it will have a significant impact on the overall efficiency of our Java applications.
In this section, we will look at a specific process of selecting algorithms, a case study, and evolving trends.
Selection process
While there is no industry-wide official algorithm selection process, here is a six-step approach:
- Fully...