Ukkonen's algorithm