I have a question about graphics.h library of C. I am trying to visualize a suffix tree in C with using graphics.h library or OpenGL library it doesn't matter. How can I write the suffixes of the given word on top of the lines? I couldn't find a way to do it. For now I can print out the suffixes like this: If the given word is (xabxac$) it will print out

  1. $[6]
  2. a[-1]
  3. bxac$[1]
  4. c$[]
  5. bxac$[2]
  6. c$[5]
  7. xa[-1]
  8. c$[3]
  9. bxac$[0]

So any help how can I visualize this like a tree in C?