Skip to content

Commit

Permalink
Shrink rb.h by replacing it with much smaller one
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleTw committed Mar 20, 2023
1 parent 32d4da1 commit d1866a1
Show file tree
Hide file tree
Showing 2 changed files with 551 additions and 1,776 deletions.
7 changes: 2 additions & 5 deletions rb/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ enum { NNODES = 1000 * 1000 };

int main(int argc, char *argv[])
{
printf("===== Self benchmark: rb =====\n");

node_t *nodes = new node_t[NNODES];

std::default_random_engine dre;
Expand All @@ -164,14 +162,13 @@ int main(int argc, char *argv[])

clock_t start = clock();

for (int i = 0; i < NNODES; ++i) {
for (int i = 0; i < NNODES; ++i)
tree_insert(&tree, nodes + i);
}

cout << " tree_insert time: "
<< (double) (clock() - start) / CLOCKS_PER_SEC << " seconds" << endl;

cout << " RB depth: " << getDepth(tree.rbt_root) << endl;
cout << " RB depth: " << getDepth(tree.root) << endl;

start = clock();

Expand Down

0 comments on commit d1866a1

Please sign in to comment.