Skip to content

Instantly share code, notes, and snippets.

@hvariant
Last active June 8, 2017 08:53
Show Gist options
  • Select an option

  • Save hvariant/dd54bcb1efb12ab4dba94acfd87c4db5 to your computer and use it in GitHub Desktop.

Select an option

Save hvariant/dd54bcb1efb12ab4dba94acfd87c4db5 to your computer and use it in GitHub Desktop.
comparing Eric's AVL tree with TreeSet
int N = 10000;
double start = System.currentTimeMillis();
bt = new AvlEmptyBinaryTree();
for (int i = 0; i < N; i++) bt = bt.insert(i);
System.out.println((System.currentTimeMillis() - start)/1000.0);
start = System.currentTimeMillis();
TreeSet<Integer> ts = new TreeSet<>();
for(int i=0;i<N;i++) ts.add(i);
System.out.println((System.currentTimeMillis() - start)/1000.0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment