Last active
June 8, 2017 08:53
-
-
Save hvariant/dd54bcb1efb12ab4dba94acfd87c4db5 to your computer and use it in GitHub Desktop.
comparing Eric's AVL tree with TreeSet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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