Skip to content

Instantly share code, notes, and snippets.

@mmtorni
Created April 23, 2019 12:26
Show Gist options
  • Save mmtorni/e3dbb032f951639b7e6df3396080fc63 to your computer and use it in GitHub Desktop.
Save mmtorni/e3dbb032f951639b7e6df3396080fc63 to your computer and use it in GitHub Desktop.
--- suffixtree.py 2019-03-25 23:52:31.649028268 +0200
+++ suffixtree_new.py 2019-04-23 15:23:06.189468905 +0300
@@ -219,6 +219,7 @@
newnode = STNode(None, None, None)
halfedge1 = (actnode, start, start + actlen - 1, newnode)
halfedge2 = (newnode, start + actlen, end, bnode)
+ bnode.setparentkey((newnode, chars[start + actlen]))
actnode.setoutedge(actkey, halfedge1)
newnode.setparentkey((actnode, actkey))
newnode.setoutedge(chars[start + actlen], halfedge2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment