Consider N points randomly distributed along a line segment of unitary length. A walker explores this disordered medium, moving according to a partially self-avoiding deterministic walk. The walker, with memory mu , leaves from the leftmost point and moves, at each discrete time step, to the nearest point that has not been visited in the preceding mu steps. Using open boundary conditions, we have calculated analytically the probability P{N}(mu)=(1-2{-mu}){N-mu-1} that all N points are visited, with N>>mu>>1 . This approximated expression for P{N}(mu) is reasonable even for small N and mu values, as validated by Monte Carlo simulations. We show the existence of a critical memory mu{1}=lnNln2 . For mu<mu{1}-e(2ln2) , the walker gets trapped in cycles and does not fully explore the system. For mu>mu{1}+e(2ln2) , the walker explores the whole system. Since the intermediate region increases as lnN and its width is constant, a sharp transition is obtained for one-dimensional large systems. This means that the walker need not have full memory of its trajectory to explore the whole system. Instead, it suffices to have memory of order log{2}N .