Please complete TO-DO 18 and TO-DO 19
// 3d: Search for an element in a binary search tree std::map<std::string, Book> dataStructureUnderTest;
const auto target_isbn = std::string("non-existent");
measure("BST", "Search", [&] (const Book& book) { dataStructureUnderTest.emplace(book.isbn, book); }, [&] (auto&) -> Book* {
/// write the lines of code (approximately 3 or 4) to search for the Book within the data structure under test with an ISBN /// matching "target_isbn". Return a pointer to the book immediately upon finding it, or a null pointer when you know the /// book is not in the container. /// Note: do not implement a linear search, i.e., do not loop from beginning to end.
return nullptr;
});
17777777777777777777777END-TO-DO(18)/777777777777777777777777777
Collect Hash Table Measurements
void collect_HashTable_measurements()
// 1e: Insert into a hash table
std::unordered_map<std::string, Book> dataStructureUnderTest;
measure("Hash Table", "Insert", [&] (const Book& book) {
/// Write the line of code to insert the key (ISBN) and value (book) into the data structure under test. You may use /// either the subscript operator, emplace, or insert function.
}, [&] (auto&) {
17777777777777777777777END-TO-DO (19) 7777777777777777777777777777
});