An algorithm is a step-by-step procedure for performing calculations. Types of algorithms include:
- Calculating a scientific formula
- Retrieving data from a data structure
- Implementing a code design pattern
Sometimes it's hard to know where to start in designing an algorithm for a task at hand. Below are some elements to consider during algorithm design.
Consider factors such as the average and worst case performance of your algorithm.
Find a code design pattern that fits the problem you're solving.
The data structure you choose should reflect your data access needs.
A database is often a good data storage choice when the data needs to be accessed using a variety of search, sort and display options.
There's a large selection of sorting algorithms to select from. See which one most closely fits the nature of your data and access requirements.