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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education