diff --git a/pretext/AlgorithmAnalysis/HashTableAnalysis.ptx b/pretext/AlgorithmAnalysis/HashTableAnalysis.ptx index 08d32d92..3d86287e 100755 --- a/pretext/AlgorithmAnalysis/HashTableAnalysis.ptx +++ b/pretext/AlgorithmAnalysis/HashTableAnalysis.ptx @@ -173,7 +173,7 @@ for i in range(10000,1000001,20000): -

summarizes the results of running +

summarizes the results of running . You can see that the hash table is consistently faster. For the smallest vector size of 10,000 elements a hash table is 89.4 times faster than a vector. For the largest vector size of 990,000 @@ -186,16 +186,16 @@ for i in range(10000,1000001,20000): contains operation took 0.004 milliseconds and for the hash table size of 990,000 it also took 0.004 milliseconds.

-
- Comparing the contains operation for C++ vectors and Hash Tables - -

The primary take away is that the graph for vectors shows an almost linear climb from - 0 elements taking almost 0 time to 1,000,000 elements taking approximately 45 seconds. For hash - tables, the function is also linear, but shows almost 0 slope from 0 elements to 1,000,000 elements - in the hash table. This reflects the linear versus constant time growth of the two - functions.

- -
+
+ Comparing the contains operation for C++ vectors and Hash Tables + +

The primary take away is that the graph for vectors shows an almost linear climb from + 0 elements taking almost 0 time to 1,000,000 elements taking approximately 69 microseconds. For hash + tables, the function is also linear, but shows almost 0 slope from 0 elements to 1,000,000 elements + in the hash table, staying at approximately 2 to 3 nanoseconds throughout. This reflects the linear + versus constant time growth of the two functions.

+ +

Since C++ is an evolving language, there are always changes going on behind the scenes. The latest information on the performance of C++ diff --git a/pretext/Figures/AlgorithmAnalysis/vectvshash2.png b/pretext/Figures/AlgorithmAnalysis/vectvshash2.png new file mode 100644 index 00000000..076b779f Binary files /dev/null and b/pretext/Figures/AlgorithmAnalysis/vectvshash2.png differ