对一棵初始为空的二叉查找树(Binary Search Tree, BST)进行若干插入或删除操作,请输出最后的二叉查找树。 bst.png 输入格式: 输入第一行为一个整数 T,表示操作数目。随后 T 行,每行为Insert K(表示插入关键词为K的结点,若树中已有关键词为K的结点,则不插入)或Remove K(表示删除关键词为K的结点,若树中无关键词为K的结点,则不删除),其中K为整数。 T 不超过2×10 5 ,树高不超过10 4 。 输出格式: 输出经上述操作后得到的二叉查找树的中根序列和先根序列,序列中每个整数后一个空格,两个序列之间用空行间隔。 输入样例: 16 Insert 17 Insert 31 Insert 13 Insert 11 Insert 20 Insert 35 Insert 25 Insert 8 Insert 4 Insert 11 Insert 24 Insert 40 Insert 27 Insert 9 Remove 17 Remove 13 输出样例: 4 8 9 11 20 24 25 27 31 35 40 20 11 8 4 9 31 25 24 27 35 40 Code Size Limit 16 KB Time Limit 500 ms Memory Limit 64 MB Stack size limit 8192 KB