/*
 * This code is from "Algorithms in C, Third Edition,"
 * by Robert Sedgewick, Addison Wesley Longman, 1998.
 * (With small alterations)
 */
#include <stdio.h>
#include <stdlib.h>
#include "Item.h"
#include "ST.h"

int main(int argc, char* argv[])
{ int N, i, M = atoi(argv[1]), seed = atoi(argv[2]); 
    Item item;
    srand(seed);
    STinit();
    for (N = i = 0; i < M; i++)
      { N++; item = ITEMrand();
	if (STsearch(key(item)) == NULLitem)
	  { STinsert(item);
/* 	    printf("+%d:\n", key(item)); /\* should be ITEMshow etc *\/ */
/* 	    STprint(); printf("\n"); fflush(stdout); */
	  }
      }
    STprint();
    printf("%d keys, ", N);
    printf("%d distinct keys\n", STcount());
    printf("Height: %d\n", STheight());
    return 0;
 }
