Ruzzo–Tompa algorithm
The Ruzzo–Tompa algorithm is a linear-time algorithm for finding all non-overlapping, contiguous, maximal scoring subsequences in a sequence of real numbers. This algorithm is an improvement over previously known quadratic time algorithms. The maximum scoring subsequence from the set produced by the algorithm is also a solution to the maximum subarray problem. The Ruzzo–Tompa algorithm has applications in bioinformatics, web scraping, and information retrieval. Applications. Bioinformatics. The Ruzzo–Tompa algorithm has been used in Bioinformatics tools to study biological data. The problem of finding disjoint maximal subsequences is of practical importance in the  analysis of DNA. Maximal subsequences algorithms have been used in the identification of transmembrane segments and the evaluation of sequence homology. The algorithm is used in sequence alignment which is used as a method of identifying similar DNA, RNA, or protein sequences. Accounting for the ordering of pairs of high-scoring subsequences in two sequences creates better sequence alignments. This is because the biological model suggests that separate high-scoring subsequence pairs arise from insertions or deletions within a matching region. Requiring consistent ordering of high-scoring subsequence pairs increases their statistical significance. Web scraping. The Ruzzo–Tompa algorithm is  used in Web scraping to extract information from web pages. Pasternack and Roth proposed a method for extracting important blocks of text from HTML documents. The web pages are first tokenized and the score for each token is found using local, token-level classifiers. A modified version of the Ruzzo–Tompa algorithm is then used to find the k highest-valued subsequences of tokens. These subsequences are then used as predictions of important blocks of text in the article. Information retrieval. The Ruzzo–Tompa algorithm has been used in Information retrieval search algorithms. Liang et al. proposed a data fusion  method to combine the search results of several microblog search algorithms. In their method, the Ruzzo–Tompa algorithm is used to detect bursts of information. Problem definition. The problem of finding all maximal subsequences is defined as follows: Given a list of real numbered scores formula_1, find the list of contiguous subsequences that gives the great total score, where the score of each subsequence formula_2. The subsequences must be disjoint (non-overlapping) and have a positive score. Other algorithms. There are several approaches to solving the all maximal scoring subsequences problem. A natural approach is to use existing, linear time  algorithms to find the maximum subsequence (see maximum subarray problem) and then recursively find the maximal subsequences to the left and right of the maximum subsequence. The analysis of this algorithm is similar to that of Quicksort: The maximum subsequence could be small in comparison to the rest of sequence, leading to a running time of formula_3 in the worst case. Algorithm. The standard implementation of the Ruzzo–Tompa algorithm runs in formula_4 time and uses "O"("n") space, where "n" is the length of the list of scores. The algorithm uses dynamic programming to progressively build the final solution by  incrementally solving progressively larger subsets of the problem. The description of the algorithm provided by Ruzzo and Tompa is as follows: The following Python code implements the Ruzzo–Tompa algorithm: def ruzzo_tompa(scores):