On suffix trees and related pattern matching problems