Use a data structure described in this book.