In this thesis, we propose a self-stabilizing algorithm for constructing depth-first trees. In self-stabilizing system ,the initial state can be any kind of state . After finite time of move , the system will reach the legitimate state. And the system will state in legitima-te state. In our algorithm , we only use log n space to solve the problem. The other one algori- thm should used nlog n space to solve this problem.