2. Node Structure Of Suffix Tree:
Each node of the tree should contain at least:
● Node number (root is 0)
● An array of children
● An array of start and end positions of the substring in the string
For example let us take the word BOOK as input
B O O K
0 1 2 3
The tree will be as shown above and the node information will be as follows.
Node 0:
Child[0] is Node 1
Child[1] is Node 2
Child[2] is Node 3
Start[0] is 0 and End[0] is 3
Start[1] is 3 and End[1] is 3
Start[2] is 1 and End[2] is 1
Node 3:
Child[0] is Node 4
Child[1] is Node 5
Start[0] is 3 and End[0] is 3
Start[1] is 2 and End[1] is 3
Input:
A string of length N