Open DaveParillo opened 1 year ago
@DaveParillo good idea! I welcome a pull-request... or I will have my students fix.
I would be willing to work on this, but . . .
{{ if response.serve_ad and settings.adsenseid: }} {{ pass }}
etc.If you are OK with me simply making changes to AlgorithmAnalysis/HashTableAnalysis.rst
and verifying those changes are valid, then I can do that.
I am assuming you would rather replace std::chrono
calls with the C time functions you use in other examples.
Describe the bug Section 2.8 claims to compare vector and hash table "contains operations".
push_back
in a loop.To Reproduce Steps to reproduce the behavior:
Sample actual results.
Expected behavior Expected results
Recommendations
Modify the text so that is is more appropriate for C++ - currently it's more of the original python description. For example: "we will confirm that the contains operator for vectors" should refer to find:
std::find
in the case of vector andstd::unordered_map::find
for the map.The listing line number references ("The difference is that on line 7 x is vector, and on line 9 x is a hash table." refer to the original python code, not the C++ in listing 6.
The text says "Listing 6 implements this comparison. Notice that we are performing exactly the same operation, number in container. " - this is not the case for the C++ listing 6.
The text says "then we will pick numbers at random and check to see if the numbers are in the vector."
Change the code to find values in each container and avoid timing container construct and fill operations.
Consider replacing
ctime
withstd::chrono
Sample solution: