struct search_within_hash_table { // Function takes no parameters, searches a hash table for a book with an ISBN // matching the target ISBN, and returns a pointer to that found book if such // a book...


struct search_within_hash_table {<br>// Function takes no parameters, searches a hash table for a book with an ISBN<br>// matching the target ISBN, and returns a pointer to that found book if such<br>// a book is found, nullptr otherwise.<br>Book* operator()(const Book& unused) {<br>//// TO-DO (21) |||<br>(/ ////<br>// Write the lines of code to search for the Book within & my_hash_table; const std::string target_isbn; }; "/>
Extracted text: struct search_within_hash_table { // Function takes no parameters, searches a hash table for a book with an ISBN // matching the target ISBN, and returns a pointer to that found book if such // a book is found, nullptr otherwise. Book* operator()(const Book& unused) { //// TO-DO (21) ||| (/ //// // Write the lines of code to search for the Book within "my_hash_table" // with an ISBN matching "target_isbn". Return a pointer to that 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. ///// END-TO-DO (21) |||// //// } std::unordered_map& my_hash_table; const std::string target_isbn; };

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here