// Driver for CSE 2320 lab 3, spring 2012 // Batched retrieval operations on red-black tree #include #include #include "topdownRB.h" main() { int inserts,searchKeys,invSelectKeys,selectKeys; int i; Key insertKey; Key *searchKey,*invSelectKey,*selectKey; int *found,*rank4invSelectKey,*selectRank; STinit(); // Initialize red-black tree scanf("%d %d %d %d",&inserts,&searchKeys,&invSelectKeys,&selectKeys); searchKey=(Key*) malloc(searchKeys*sizeof(Key)); found=(int*) malloc(searchKeys*sizeof(int)); invSelectKey=(Key*) malloc(invSelectKeys*sizeof(Key)); rank4invSelectKey=(int*) malloc(invSelectKeys*sizeof(int)); selectRank=(int*) malloc(selectKeys*sizeof(int)); selectKey=(Key*) malloc(selectKeys*sizeof(Key)); if (!searchKey || !found || !invSelectKey || !rank4invSelectKey || !selectRank || !selectKey) { printf("malloc prob\n"); exit(0); } for (i=0;irank results\n"); for (i=0;ikey results\n"); for (i=0;i