The shunting operation plan is the specific action plan to ensure the shunting of the large freight train depot at the present stage. The shunting district head relies on it to supervise the implementation of shunting operation and lead the shunting work. Due to different shunting equipment and work division in each depot, there will be differences in the methods of preparing plan. Different preparation methods have a great impact on the efficiency of shunting operation, therefore, mainly studying the preparation method of shunting Plan in depot in this paper, i.e. the plan is obtained by the Binary Sorted Tree (BST). Firstly, the BST in line with the shunting of the depot is established; Secondly, the shunting scheme is obtained by traversing the established BST, and the scheme is screened and evaluated to obtain the optimal scheme; Thirdly, using the computer simulate the collection process and generate the shunting plan. Finally, the C++ program is used to output the shunting operation notice.