14.7 Practice using C++ hash templates C++ has two built in hash structures that will suite for most programming needs of hashes. The two types are unorderedmap and orderedmap. In this weeks program you are going to practice creating, inserting and iterating over the two types of maps. Your assignment is to create an unordered map and an ordered map, both with have key value pairs of type . You will read the key value pairs in from a dataFile using the file stream operator storing the first value (an integer into the integer key) and the second one into a string. You will then insert each pair into both the unordered and ordered maps. Lastly you will use an interator to iterate through the map printing them out. Your output should make it clear by label which list is the ordered map and which is the unordered map. The test provided is merely for your assistance - your program will be graded on it's content regardless of the results of book test. You will need the following references to help you with this assignment: https://www.cplusplus.com/reference/unorderedmap/unorderedmap/unordered_map/ https://www.cplusplus.com/reference/map/map/map/ https://www.cplusplus.com/reference/map/map/begin/ main.cpp #include #include #include #include #include using namespace std; typedef unsigned int uint; int main() {    //create two hashes -    //one using unordered map    //one using ordered map    //read in the key data pairs from dataList    //store in both maps    //iterate through both using auto    //print the data }   dataList.document 1 John 2 Jacob 3 Jingle 4 Heimer 5 Schmidt 6 His 7 name 8 is 9 my 10 name 11 too

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 17SA
icon
Related questions
icon
Concept explainers
Question

14.7 Practice using C++ hash templates

C++ has two built in hash structures that will suite for most programming needs of hashes. The two types are unorderedmap and orderedmap. In this weeks program you are going to practice creating, inserting and iterating over the two types of maps. Your assignment is to create an unordered map and an ordered map, both with have key value pairs of type . You will read the key value pairs in from a dataFile using the file stream operator storing the first value (an integer into the integer key) and the second one into a string. You will then insert each pair into both the unordered and ordered maps. Lastly you will use an interator to iterate through the map printing them out. Your output should make it clear by label which list is the ordered map and which is the unordered map. The test provided is merely for your assistance - your program will be graded on it's content regardless of the results of book test.

You will need the following references to help you with this assignment:

https://www.cplusplus.com/reference/unorderedmap/unorderedmap/unordered_map/ https://www.cplusplus.com/reference/map/map/map/ https://www.cplusplus.com/reference/map/map/begin/

main.cpp

#include <fstream>
#include <map>
#include <unordered_map>
#include <string>
#include <iostream>


using namespace std;

typedef unsigned int uint;
int main() {
   //create two hashes -
   //one using unordered map
   //one using ordered map
   //read in the key data pairs from dataList
   //store in both maps
   //iterate through both using auto
   //print the data
}

 

dataList.document

1 John
2 Jacob
3 Jingle
4 Heimer
5 Schmidt
6 His
7 name
8 is
9 my
10 name
11 too

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Types of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning