Some algorithms and data structures