原书出处
Introduction to Algorithms, Fourth Edition
32 第32章 字符串匹配
ed in Θ(n) time from the BWT. Let’s look at the BWT of rutabaga, denoting it by BWT[1:n].
Each character in the BWT has a unique lexicographic rank from 1 to n. Denote the rank of BWT[i] by rank[i]. If a character appears multiple times in the BWT, each instance of the character has a rank 1 greater than the previous instance of the character. Here are BWT and rank for rutabaga: For example, rank[1] = 2 because BWT[1] = a and the only character that precedes the first a lexicographically is $ (which we defined to precede all other characters, so that $ has rank 1). Next, we have rank[2] = 6 because BWT[2] = g and five characters in the BWT precede g lexicographically: $, the three instances of a, and b. Jumping ahead to rank
[5] = 3, that is because BWT[5] = a, and because this a is the second instance of a in the
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Introduction to Algorithms, Fourth Edition/_epub-src/OEBPS/chapter032.xhtml
EPUB SHA-256:ec7ced04bb875b93983816aef7a667855a4b71c5cf53b63406b9439c74e27aea