SLIDE 93 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Preamble Repeats Generalized Suffjx Tree More Repeats LCA LCE Preamble Repeats Generalized Suffjx Tree More Repeats LCA LCE
Lowest Common Ancestor Problem (Overview)
(Although not necessary) Let’s also make the following assumptions.
- 1. O(log n) bits can be compared, added, subtracted,
multiplied, or divided in constant time.
- 2. bit-level operations on O(log n) bits numbers can be
performed in constant time, including AND, OR, XOR, left or right shift by up to O(log n) bits, creating masks of 1s, and fjnding the position of the left-most or right-most 1.
It can be shown, but we will not, that after a linear amount of time pre-processing the input tree, linear w.r.t. the number of nodes, the lca of any two nodes can be found in constant time! See (Gusfjeld 1997) §8.
Marcel Turcotte
- CSI5126. Algorithms in bioinformatics