Tag Data Structures and Algorithms