#include #include typedef struct node* link; struct node { int key; link l,r; }; link load(int count) { // Linear-time inorder loading of BST from file int leftCount,rightCount; link work,left; if (count==0) return NULL; leftCount=count/2; rightCount=count-leftCount-1; left=load(leftCount); work=(link) malloc(sizeof(struct node)); work->l=left; scanf("%d",&work->key); work->r=load(rightCount); return work; } void print(link h,int level) { // Print indented tree from right-to-left int i; if (!h) { for (i=0;ir,level+1); for (i=0;ikey); print(h->l,level+1); } int main() { int n; link root; scanf("%d",&n); root=load(n); print(root,0); }