二叉樹的重建和其遍歷

給出二叉樹的前序和中序遍歷,要求重建出二叉樹並遍歷之。 前序遍歷:4 2 1 3 6 5 7 8 10  中序遍歷:1 2 3 4 5 6 7 8 10  二叉樹如下圖: import org.junit.Test; import java.util.LinkedList; import java.util.Queue; import java.util.Stack; public class
相關文章
相關標籤/搜索