Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int insert(int root, int l, int r) {
- position cur = position( root, 0 );
- for(int i=l;i<r;i++) {
- position nxt = readChar(cur, s[i]);
- if(nxt.v == -1) {
- return addChild(i, r, splitEdge(cur) );
- }
- else
- cur = nxt;
- }
- return splitEdge(cur);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement