Data Structures for Density Estimation