13.10.2014 Views

OPTIMIZING THE JAVA VIRTUAL MACHINE INSTRUCTION SET BY ...

OPTIMIZING THE JAVA VIRTUAL MACHINE INSTRUCTION SET BY ...

OPTIMIZING THE JAVA VIRTUAL MACHINE INSTRUCTION SET BY ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

204<br />

Algorithm SplitLeaves(node n)<br />

For each branch, b, leaving n<br />

If the node, m, at the end of b is a leaf and the label on b starts with<br />

a character in Sigma<br />

Create a new node, p<br />

Create a branch, c, from p to m<br />

Change the target of branch b to node p<br />

Find the position, x, of the first sentinel character in the label on b<br />

using a binary search on the list of sentinel character positions<br />

Label c with all characters from x to the end of the string<br />

Change the label on b so that it only includes those characters<br />

before x<br />

Else<br />

SplitLeaves(b.Target)<br />

End For<br />

Figure 9.2: Algorithm SplitLeaves<br />

score can be recorded in the node and utilized later or a single variable can be used<br />

to record the best string and its score encountered so far.<br />

Examining Figure 9.4 reveals that the most contributory substring is abab. This<br />

is determined by identifying the string that is formed by traversing the tree from the<br />

root to the node that has the highest score. For this example, a score of 12 is the<br />

highest value present in the tree. The occurrences of the most contributory string,<br />

abab are illustrated below.<br />

ababab$abab#<br />

9.5 Handling Overlapping Occurrences<br />

It is important to observe that the single underlined and single over-lined occurrences<br />

of abab are overlapping. While this may not be a problem for some applications,<br />

overlapping occurrences of the string are of little use for others. In particular, any<br />

application that “uses up” the string once it is identified will destroy the subsequent<br />

overlapping occurrence(s). Multicode substitution is an example of an instance where<br />

the identified string is used up. Consequently it is highly desirable to overcome

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!