Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Expert C++

You're reading from   Expert C++ Become a proficient programmer by learning coding best practices with C++17 and C++20's latest features

Arrow left icon
Product type Paperback
Published in Aug 2023
Publisher Packt
ISBN-13 9781804617830
Length 604 pages
Edition 2nd Edition
Languages
Arrow right icon
Authors (5):
Arrow left icon
Araks Tigranyan Araks Tigranyan
Author Profile Icon Araks Tigranyan
Araks Tigranyan
Shunguang Wu Shunguang Wu
Author Profile Icon Shunguang Wu
Shunguang Wu
John Asatryan John Asatryan
Author Profile Icon John Asatryan
John Asatryan
Marcelo Guerra Hahn Marcelo Guerra Hahn
Author Profile Icon Marcelo Guerra Hahn
Marcelo Guerra Hahn
Vardan Grigoryan Vardan Grigoryan
Author Profile Icon Vardan Grigoryan
Vardan Grigoryan
+1 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (24) Chapters Close

Preface 1. Part 1:Under the Hood of C++ Programming
2. Chapter 1: Building C++ Applications FREE CHAPTER 3. Chapter 2: Beyond Object-Oriented Programming 4. Chapter 3: Understanding and Designing Templates 5. Chapter 4: Template Meta Programming 6. Chapter 5: Memory Management and Smart Pointers 7. Part 2: Designing Robust and Efficient Applications
8. Chapter 6: Digging into Data Structures and Algorithms in STL 9. Chapter 7: Advanced Data Structures 10. Chapter 8: Functional Programming 11. Chapter 9: Concurrency and Multithreading 12. Chapter 10: Designing Concurrent Data Structures 13. Chapter 11: Designing World-Ready Applications 14. Chapter 12: Incorporating Design Patterns in C++ Applications 15. Chapter 13: Networking and Security 16. Chapter 14: Debugging and Testing 17. Chapter 15: Large-Scale Application Design 18. Part 3:C++ in the AI World
19. Chapter 16: Understanding and Using C++ in Machine Learning Tasks 20. Chapter 17: Using C++ in Data Science 21. Chapter 18: Designing and Implementing a Data Analysis Framework 22. Index 23. Other Books You May Enjoy

Implementation details of std::unordered_map

In the previous chapter, we discussed std::unordered_map very briefly, saying only that it is the representation of the hash table data structure in C++. At first, along with other hash containers, std::unordered_map wasn’t in the original STL. It was introduced to C++ users only with the TR1 library extension.

std::unordered_map is an associative container that is part of the STL library. It holds key-value pairs with distinctive keys. The time complexity of search, insertion, and removal of items is amortized O(1). This means that all the operations listed are performed in a constant time almost always. In an unordered map, the key value often serves as a means of uniquely identifying each element, and the mapped value is an object connected to that key. Key-value and mapped value types may vary.

Internally, the components are arranged into buckets rather than being sorted in any specific sequence. The hash of an element&...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime