Simulating Multiple Memory Accesses in Logarithmic Time and Linear Space