This article is about the availability of input for an algorithm; The online / offline distinction is also used for tasks that are performed 'in advance' or 'live', such as (for) editing data.
In the computer science, an online algorithm is an algorithm in which the entry does not have to be completely known when the algorithm begins. This is opposed to an offline algorithm with the entire input being known before the algorithm can begin. For example, insertion sort can be implemented as an online algorithm, but with selection sort it is not possible (in selection sort, the list must be fully known, not insertion sort). In online algorithms, the answer may not be optimal because not all information is known in advance. Examples
Some other examples of online algorithms are: Analysis
The online algorithm competitiveness is used to analyze the quality of online algorithms. In doing so, the performance of the algorithm is compared with the optimal response one could obtain if all information was known in advance. One analyzes how well the algorithm performs on favorable, average, and poor input, and how far the answer can differ from the optimal response.
For example, an online algorithm can theoretically give very bad answers, but this only occurs with input that will not or hardly occur in reality; An online algorithm can therefore be an improvement over an offline algorithm (such as time gain and the associated cost savings).
This approach resembles the analysis done for approximation algorithms comparing the approach to the answer to the actual answer.
wiki