A depth-first search version of Dhar's burning algorithm is used to give a bijection between the parking functions of a graph and labeled spanning trees, relating the degree of the parking function with the number of inversions of the spanning tree. Specializing to the complete graph answers a problem posed by R. Stanley. 10 pages, 3 figures; to appear in Combinatorica