Question

Can someone write the psuedo code of Ukkonen's algorithm with how each line works and why...

Can someone write the psuedo code of Ukkonen's algorithm with how each line works and why this algorithm is used.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Definition:

  • Ukkonen's algorithm is a method of constructing the suffix tree of a string in linear time.
  • Suffix trees are very useful.
  • A sufffix tree is very efficient way to find out how many times a given substring occurs within the string.

A suffix tree T for a m-character string S is a rooted directed tree with exactly m leaves numbered 1 to m.

  • In this tree a root can have zero, one or more children.
  • In this tree each internal node, other than the root, has at least two children.
  • In this tree each edge is labelled with a nonempty substring of S.
  • In this tree no two edges coming out of same node can have edge-labels beginning with the same character.

Why do we use Ukkonen's Algorithm:

Here are some applications that can be achieved using the algorithm:

  • We can find exact string matching using this algorithm.
  • We can count the number of pattern occurrences.
  • We can create a generalized suffix tree.
  • We can find a longest common substring (of two strings).
  • We can find lowest common ancestor.
  • We can find longest common prefix.
  • We can find maximal palindromes.

Psuedo code for the algorithm:

Please refer the following for example:

** Here I am explaining the algorithm with a string "banana$" **

A)

B)

C)

D)

E)

F)

G)

Add a comment
Know the answer?
Add Answer to:
Can someone write the psuedo code of Ukkonen's algorithm with how each line works and why...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT