The suffix binary search tree and suffix AVL tree

  • Authors:
  • Robert W. Irving;Lorna Love

  • Affiliations:
  • Department of Computing Science, University of Glasgow, Glasgow G12 8RZ, Scotland, UK;Department of Computing Science, University of Glasgow, Glasgow G12 8RZ, Scotland, UK

  • Venue:
  • Journal of Discrete Algorithms
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

Suffix trees and suffix arrays are classical data structures that are used to represent the set of suffixes of a given string, and thereby facilitate the efficient solution of various string processing problems--in particular on-line string searching. Here we investigate the potential of suitably adapted binary search trees as competitors in this context. The suffix binary search tree (SBST) and its balanced counterpart, the suffix AVL-tree, are conceptually simple, relatively easy to implement, and offer time and space efficiency to rival suffix trees and suffix arrays, with distinct advantages in some circumstances--for instance in cases where only a subset of the suffixes need be represented.Construction of a suffix BST for an n-long string can be achieved in O(nh) time, where h is the height of the tree. In the case of a suffix AVL-tree this will be O(n log n) in the worst case. Searching for an m-long substring requires O(m + l) time, where l is the length of the search path. In the suffix AVL-tree this is O(m + log n) in the worst case. The space requirements are linear in n, generally intermediate between those for a suffix tree and a suffix array.Empirical evidence, illustrating the competitiveness of suffix BSTs, is presented.