data structure and simple algorithms