In this paper, we develop a Robinson-Schensted algorithm for the walled Brauer algebras which gives the bijection between the walled Brauer diagram d and the pairs of standard tri-tableaux of shape lambda = (lambda(1),lambda(2),lambda(3)) with lambda(1) = (2(f)), lambda(2) proves r -f and lambda(3) proves s - f, for 0 <= f <= min(r, s). As a biproduct, we define aRobinsonSchensted correspondence for the walled signed Brauer algebras which gives the correspondence between the walled signed Brauer diagram d and the pairs of standard signed-tri-tableaux of shape lambda = (lambda(1),lambda(2),lambda(3)) with lambda(1) = (2(2f)), lambda(2) proves(b) r -f and lambda(3) proves(b) s - f, for 0 <= f <= min(r, s). We also derive the Knuth relations and the determinantal formula for the walled Brauer and the walled signed Brauer algebras by using the Robinson-Schensted correspondence.