#coding:utf-8 class node(): def __init__(self,k=None,l=None,r=None): self.key=k; self.left=l; self.right=r; def create(root): a=input('enter a key:'); if a is '#': root=None; else: root=node(k=a); root.left=create(root.left); root.right=create(root.r…
javase-常用三种遍历方法 import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class Bianli { public static void main(String[] args) { List<String> list = new ArrayList<String>(); list.add("add"); list.add("…