/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ #include #include #include "Element.h" #include "Set.h" int main(int argc, char *argv[]) { unsigned int noOfElems = 1000; if (argc == 2) sscanf(argv[1], "%u", &noOfElems); fprintf(stderr, "%s %u %s", "run red black trees with inserting", noOfElems, "elements in ascending order\n" ); { Set s = mkEmptySet(); unsigned int i; for (i = 0; i < noOfElems; ++i) { s = insertElem((Element) i, s); } fprintf(stderr, "card(s) = %u\n", card(s)); fprintf(stderr, "minPathLength(s) = %u\n", minPathLength(s)); fprintf(stderr, "maxPathLength(s) = %u\n", maxPathLength(s)); } return 0; }