Starting Out with C++ from Control Structures to Objects Plus MyLab Programming with Pearson eText -- Access Card Package (9th Edition)
9th Edition
ISBN: 9780134544847
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 17, Problem 5RQE
Explanation of Solution
Difference between “map” and “unordered_map”
map | Unordered_map |
Maps are associative container. It is also called as “key-value” pairs. | Unordered_map are unordered associative container. |
It is used to retrieve the elements with the help of the key values. | It is also used to retrieve the elements, but not concerned with the key order. |
In order to use “map” class, the “<map>” header file should be included in the program. | In order to use “unordered_map” class, the “<map>” header file should be included in the program... |
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
In C++.
Please discribe
What is the difference between Set and Map?
Chapter 17 Solutions
Starting Out with C++ from Control Structures to Objects Plus MyLab Programming with Pearson eText -- Access Card Package (9th Edition)
Ch. 17.2 - Prob. 17.1CPCh. 17.2 - Prob. 17.2CPCh. 17.2 - Prob. 17.3CPCh. 17.2 - Suppose you are writing a program that uses the...Ch. 17.2 - Prob. 17.5CPCh. 17.2 - Prob. 17.6CPCh. 17.2 - What does a containers begin() and end() member...Ch. 17.2 - Prob. 17.8CPCh. 17.2 - Prob. 17.9CPCh. 17.2 - Prob. 17.10CP
Ch. 17.3 - Write a statement that defines an empty vector...Ch. 17.3 - Prob. 17.12CPCh. 17.3 - Prob. 17.13CPCh. 17.3 - Write a statement that defines a vector object...Ch. 17.3 - What happens when you use an invalid index with...Ch. 17.3 - Prob. 17.16CPCh. 17.3 - If your program will be added a lot of objects to...Ch. 17.3 - Prob. 17.18CPCh. 17.3 - Prob. 17.19CPCh. 17.4 - Prob. 17.20CPCh. 17.4 - Write a statement that defines a nap named myMap....Ch. 17.4 - Prob. 17.22CPCh. 17.4 - Prob. 17.23CPCh. 17.4 - Prob. 17.24CPCh. 17.4 - Prob. 17.25CPCh. 17.4 - Prob. 17.26CPCh. 17.4 - Prob. 17.27CPCh. 17.5 - What are two differences between a set and a...Ch. 17.5 - Write a statement that defines an empty set object...Ch. 17.5 - Prob. 17.30CPCh. 17.5 - Prob. 17.31CPCh. 17.5 - Prob. 17.32CPCh. 17.5 - If you store objects of a class that you have...Ch. 17.5 - Prob. 17.34CPCh. 17.5 - Prob. 17.35CPCh. 17.6 - Prob. 17.36CPCh. 17.6 - What value will be stored in v[0] after the...Ch. 17.6 - Prob. 17.38CPCh. 17.6 - Prob. 17.39CPCh. 17.6 - Prob. 17.40CPCh. 17.6 - Prob. 17.41CPCh. 17.6 - Prob. 17.42CPCh. 17.7 - Prob. 17.43CPCh. 17.7 - Which operator must be overloaded in a class...Ch. 17.7 - Prob. 17.45CPCh. 17.7 - What is a predicate?Ch. 17.7 - Prob. 17.47CPCh. 17.7 - Prob. 17.48CPCh. 17.7 - Prob. 17.49CPCh. 17 - Prob. 1RQECh. 17 - Prob. 2RQECh. 17 - If you want to store objects of a class that you...Ch. 17 - If you want to store objects of a class that you...Ch. 17 - Prob. 5RQECh. 17 - Prob. 6RQECh. 17 - Prob. 7RQECh. 17 - If you want to store objects of a class that you...Ch. 17 - Prob. 9RQECh. 17 - Prob. 10RQECh. 17 - How does the behavior of the equal_range() member...Ch. 17 - Prob. 12RQECh. 17 - When using one of the STL algorithm function...Ch. 17 - You have written a class, and you plan to store...Ch. 17 - Prob. 15RQECh. 17 - Prob. 16RQECh. 17 - Prob. 17RQECh. 17 - Prob. 18RQECh. 17 - Prob. 19RQECh. 17 - Prob. 20RQECh. 17 - Prob. 21RQECh. 17 - A(n) ___________ container stores its data in a...Ch. 17 - _____________ are pointer-like objects used to...Ch. 17 - Prob. 24RQECh. 17 - Prob. 25RQECh. 17 - The _____ class is an associative container that...Ch. 17 - Prob. 27RQECh. 17 - Prob. 28RQECh. 17 - A _______ object is an object that can be called,...Ch. 17 - A _________ is a function or function object that...Ch. 17 - A ____________ is a predicate that takes one...Ch. 17 - A __________ is a predicate that takes two...Ch. 17 - A __________ is a compact way of creating a...Ch. 17 - T F The array class is a fixed-size container.Ch. 17 - T F The vector class is a fixed-size container.Ch. 17 - T F You use the operator to dereference an...Ch. 17 - T F You can use the ++ operator to increment an...Ch. 17 - Prob. 38RQECh. 17 - Prob. 39RQECh. 17 - T F You do not have to declare the size of a...Ch. 17 - T F A vector uses an array internally to store its...Ch. 17 - Prob. 42RQECh. 17 - T F You can store duplicate keys in a map...Ch. 17 - T F The multimap classs erase() member function...Ch. 17 - Prob. 45RQECh. 17 - Prob. 46RQECh. 17 - Prob. 47RQECh. 17 - Prob. 48RQECh. 17 - T F If two iterators denote a range of elements...Ch. 17 - T F You must sort a range of elements before...Ch. 17 - T F Any class that will be used to create function...Ch. 17 - T F Writing a lambda expression usually requires...Ch. 17 - T F You can assign a lambda expression to a...Ch. 17 - Prob. 54RQECh. 17 - Write a statement that defines an iterator that...Ch. 17 - Prob. 56RQECh. 17 - The following statement defines a vector of ints...Ch. 17 - Prob. 58RQECh. 17 - Prob. 59RQECh. 17 - The following code defines a vector and an...Ch. 17 - The following statement defines a vector of ints...Ch. 17 - Prob. 62RQECh. 17 - Prob. 63RQECh. 17 - Prob. 64RQECh. 17 - Look at the following vector definition: vectorint...Ch. 17 - Write a declaration for a class named Display. The...Ch. 17 - Write code that docs the following: Uses a lambda...Ch. 17 - // This code has an error. arrayint, 5 a; a[5] =...Ch. 17 - // This code has an error. vectorstring strv =...Ch. 17 - // This code has an error. vectorint numbers(10);...Ch. 17 - // This code has an error. vectorint numbers ={1,...Ch. 17 - Prob. 72RQECh. 17 - Prob. 73RQECh. 17 - // This code has an error. vectorint v = {6, 5, 4,...Ch. 17 - // This code has an error. auto sum = ()[int a,...Ch. 17 - Unique Words Write a program that opens a...Ch. 17 - Course Information Write a program that creates a...Ch. 17 - Prob. 3PCCh. 17 - File Encryption and Decryption Write a program...Ch. 17 - Prob. 5PCCh. 17 - Prob. 6PCCh. 17 - Prob. 7PCCh. 17 - Prob. 8PC
Knowledge Booster
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
- A map interface's list collection viewsarrow_forwardYou are writing an application for the 911 dispacher office for a city. You need a data structure that will allow you to store all the residents' phone numbers and addresses. The common operations performed on the set of objects are: lookup an address based on the calling phone number. The client wants the program to be as efficient as possible. Which of the following data structures should you use in your design? Question 43 options: Hash table Binary search tree Heap Sorted linked Listarrow_forwardYou are writing an application. You need a data structure that will allow you to insert new elements. In addition, you must sometimes remove the maximum element and other times simply report the value of the maximum element. The client wants the program to be as efficient as possible. Which of the following data structures should you use in your design? Question 24 options: Unsorted linked list Hash table Array Sorted linked list Heaparrow_forward
- Create a node class named LinkedNodes that uses up to 4 dynamic pointers to connect it to the other 8 nodes in the structure (a total of 9). The data in each node will be a unique integer number from 1 through 9. Include in your class definition these functions at a minimum: getVal(), setVal(), getNext(), setNext(), getPrev(), setPrev(), constructor(s) and destructor. Write a simple program to load these nodes into a linked structure. Do not use an array, the pointers will do that for you. You should be able to reach any node from any other node in the structure by traversing a maximum of 2 nodes from the current one. The output from your program should report the traversals between all nodes in the structure, starting with the node whose value is one. (See the example below) Node 1 2 3 4 5 6 7 8 9 -> Traverses to Node 1 Node 2 1->2 2->6->1 3->6->1 3->7->2 4->6->1 4->7->2 4->8->3 5->6->1 5->7->2 5->8->3 6->1->2 6->1->3 7->1->3 8->3 6->1 7->1 8->1 9->1 Node 3 1->3 2->3 7->2 8->2 9->2…arrow_forward#ifndef ___LINKED_LIST_H___#define ___LINKED_LIST_H___ #include<stdlib.h> typedef struct LINKED_LIST_NODE_s *LINKED_LIST_NODE;typedef struct LINKED_LIST_NODE_s {LINKED_LIST_NODE next;void *data;} LINKED_LIST_NODE_t[1]; typedef struct LINKED_LIST_s *LINKED_LIST;typedef struct LINKED_LIST_s {LINKED_LIST_NODE head;} LINKED_LIST_t[1]; //IMPLEMENT THESE FUNCTIONSLINKED_LIST linked_list_init();void linked_list_free(LINKED_LIST list);int linked_list_prepend(LINKED_LIST list, void *data);int linked_list_append(LINKED_LIST list, void *data);int linked_list_insert(LINKED_LIST list, void *data, int idx);void *linked_list_set(LINKED_LIST list, void *data, int idx);void *linked_list_get(LINKED_LIST list, int idx);void *linked_list_remove(LINKED_LIST list, int idx);void linked_list_removeall(LINKED_LIST list);void linked_list_concatenate(LINKED_LIST list, LINKED_LIST list2); LINKED_LIST linked_list_init(){LINKED_LIST list;list = (LINKED_LIST)malloc(sizeof(LINKED_LIST_t));if(list != NULL)…arrow_forwardExplain the difference between ls -l > mylisting.txt and ls -l >> mylisting.txtarrow_forward
- What function does this Syntax perform? function myMap() {var map Canvas = document.getElementById("map");var mapOptions = {center: new google.maps.LatLng(51.5, -0.2),zoom: 10};var map = new google.maps.Map(mapCanvas, mapOptions);}arrow_forwardConcatenate Map This function will be given a single parameter known as the Map List. The Map List is a list of maps. Your job is to combine all the maps found in the map list into a single map and return it. There are two rules for addingvalues to the map. You must add key-value pairs to the map in the same order they are found in the Map List. If the key already exists, it cannot be overwritten. In other words, if two or more maps have the same key, the key to be added cannot be overwritten by the subsequent maps. Signature: public static HashMap<String, Integer> concatenateMap(ArrayList<HashMap<String, Integer>> mapList) Example: INPUT: [{b=55, t=20, f=26, n=87, o=93}, {s=95, f=9, n=11, o=71}, {f=89, n=82, o=29}]OUTPUT: {b=55, s=95, t=20, f=26, n=87, o=93} INPUT: [{v=2, f=80, z=43, k=90, n=43}, {d=41, f=98, y=39, n=83}, {d=12, v=61, y=44, n=30}]OUTPUT: {d=41, v=2, f=80, y=39, z=43, k=90, n=43} INPUT: [{p=79, b=10, g=28, h=21, z=62}, {p=5, g=87, h=38}, {p=29,…arrow_forwardcard_t * moveCardBack (card t *head); The moveCardBack function will take the card in front of the pile and place it in the back. In coding terms, you are taking the head of the linked list and moving it to the end. The function has one parameter which is the head of the linked list. After moving the card to the back, the function returns the new head of the linked list.arrow_forward
- QUESTION 11 You need to store a list of messages so that the most recently-added message is always first. Should you use an ArrayList or a LinkedList? It doesn't matter in this case. Linked List ArrayList QUESTION 12 You need to store a collection of employees in a big company so that you can look them up by name. Should you use an List, a Map, or or a Set? O It doesn't matter in this case. List Set Maparrow_forwardWhich of the following code segments can be used as a constructor for a node in a linked list. Each node contains a pointer to the next node called next and also has a String called data. O public node () { next = 0; } } public node () { next = "";} } O public node () { next = null; } } O public node () { next = new node(); }arrow_forwardPOEM_LINE = str POEM = List[POEM_LINE] PHONEMES = Tuple[str] PRONUNCIATION_DICT = Dict[str, PHONEMES] def all_lines_rhyme(poem_lines: POEM, lines_to_check: List[int], word_to_phonemes: PRONUNCIATION_DICT) -> bool: """Return True if and only if the lines from poem_lines with index in lines_to_check all rhyme, according to word_to_phonemes. Precondition: lines_to_check != [] >>> poem_lines = ['The mouse', 'in my house', 'electric.'] >>> lines_to_check = [0, 1] >>> word_to_phonemes = {'THE': ('DH', 'AH0'), ... 'MOUSE': ('M', 'AW1', 'S'), ... 'IN': ('IH0', 'N'), ... 'MY': ('M', 'AY1'), ... 'HOUSE': ('HH', 'AW1', 'S'), ... 'ELECTRIC': ('IH0', 'L', 'EH1', 'K', ... 'T', 'R', 'IH0', 'K')} >>> all_lines_rhyme(poem_lines, lines_to_check, word_to_phonemes) True…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education