This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
lecture_notes:04-22-2011 [2011/06/09 23:56] eyliaw |
lecture_notes:04-22-2011 [2011/06/09 23:56] eyliaw |
||
---|---|---|---|
Line 50: | Line 50: | ||
| 7 | LO$OOGG | 2 | 1 | 3 | | | 7 | LO$OOGG | 2 | 1 | 3 | | ||
- | There are then two recursive formulas to find the start and end positions of a substring: | + | There are then two recursive formulas to find the start and end positions of a substring. |
End R_(aW) = C(a) + O(a,R_(W) - 1) + 1 or 1 if W is the empty string | End R_(aW) = C(a) + O(a,R_(W) - 1) + 1 or 1 if W is the empty string | ||
Start R-(aW) = C(a) + O(a,R-(W)) or n - 1 if W is the empty string | Start R-(aW) = C(a) + O(a,R-(W)) or n - 1 if W is the empty string |