We may earn an affiliate commission when you visit our partners.
Pluralsight logo

C++ Standard Library

Associative Containers

Giovanni Dicanio

This course will teach you in a practical way, with slides and demo code, how to use important associative containers available in the C++ Standard Library (e.g. std::map). You will learn their pros and cons, and common operations.

Read more

This course will teach you in a practical way, with slides and demo code, how to use important associative containers available in the C++ Standard Library (e.g. std::map). You will learn their pros and cons, and common operations.

Non-trivial computer programs need to store data and process it. Developing data structures and containers from scratch in C++ is a daunting and bug-prone task. In fact, you would have to consider advanced aspects like manual memory and resource management, proper handling subtle corner cases, writing both generic code and code that is optimized for special cases, and so on. Moreover, there are some data structures like balanced binary search trees or hash tables that are very useful in applications; however, it is definitely non-trivial to implement from scratch.

Thankfully, the C++ Standard Library already offers containers that are high-quality, efficient, and well-tested. It’s a joy to develop C++ code reusing them: in fact, using these containers in your C++ code will boost your productivity, as the C++ Standard Library gives you on a platter high-quality implementations of common and useful data structures that you can easily leverage in your C++ code. C++ Standard Library’s maintainers spend hours looking at these data structures, and improving, refining, and optimizing their C++ implementation code. In this course, C++ Standard Library: Associative Containers, you will learn how to simply reuse that treasure in your own C++ applications.

First, you will explore std::map, which isa very versatile and convenient associative container that you can use when you need to associate some unique keys to additional values. This can come in handy in lots of applications, from translation dictionaries, to computer graphics programs to databases.

Next, you will discover important operations, like inserting, removing, and searching elements. You will first see them described in theory using slides, including a discussion of their asymptotic runtime complexity. Then, you’ll also see them in action in practical demo code. You will also touch on how to achieve even better performance than std::map, using std::unordered_map. You’ll see how that comes at a cost, though, like losing element ordering that is guaranteed by std::map. Then, you will see a practical demo code with a benchmark comparing std::unordered_map vs. std::map performance in action.

Finally, you will learn how to easily store unique elements in a specific container, maintaining element ordering. This is possible using std::set. You will see how to store custom objects in std::set, including how to fix a subtle bug. I hope that discussing subtle bugs that are especially frequent for those starting to learn the C++ Standard Library containers will save you precious time and headache during your C++ programming. To proficiently follow this course, you only need a basic knowledge of C++ language features. You also need to know some basic architectural elements ofthe C++ Standard Library, like iterators, that are described in my “C++ Standard Library: Sequential Containers” course.

After completing this course, you will be able to use high-quality efficient and well-tested C++ Standard Library associative containers like std::map, std::unordered_map and std::set in your own C++ code. You will have practical knowledge about them, and be able to make proper judgement about picking one or the other based on the problem at hand. You will also have knowledge about important common operations with these standard associative containers such as inserting, removing, and searching elements.

Enroll now

What's inside

Syllabus

Course Overview
Storing Unique Objects with std::set
Mapping Unique Keys to Values with std::map
Efficient Key-value Associations with std::unordered_map
Read more

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Provides guidance and practical advice for solving frequent issues in data structures implementation
Covers both the theoretical and practical aspects of associative containers, ensuring a well-rounded understanding
Taught by Giovanni Dicanio, a recognized expert in C++ Standard Library implementation
Introduces high-quality and efficient C++ Standard Library containers, enhancing code quality and productivity
Suitable for learners with basic knowledge of C++ language features and iterators, making it accessible to beginners

Save this course

Save C++ Standard Library: Associative Containers to your list so you can find it easily later:
Save

Activities

Coming soon We're preparing activities for C++ Standard Library: Associative Containers. These are activities you can do either before, during, or after a course.

Career center

Learners who complete C++ Standard Library: Associative Containers will develop knowledge and skills that may be useful to these careers:
Data Scientist
Data Scientists use data to solve business problems. They are responsible for collecting, cleaning, and analyzing data to identify trends and patterns. If you want to use data to solve business problems, this course may be useful for you.
Software Engineer
Software Engineers design, develop, and test software systems. They are responsible for ensuring that the software is reliable, efficient, and meets the needs of the users. If you want to design, develop, or test software systems, this course may be useful for you.
Data Analyst
Data Analysts collect, clean, and analyze data to identify trends and patterns. They are responsible for communicating the results of their analysis to business stakeholders. If you want to collect, clean, and analyze data to identify trends and patterns, this course may be useful for you.
Database Administrator
Database Administrators are responsible for managing and maintaining databases. They are responsible for ensuring that the data is secure, reliable, and available to the users. If you want to manage and maintain databases, this course may be useful for you.
Web Developer
Web Developers design and develop websites and web applications. They are responsible for ensuring that the websites and web applications are user-friendly, efficient, and meet the needs of the users. If you want to design and develop websites and web applications, this course may be useful for you.
Information Security Analyst
Information Security Analysts are responsible for protecting computer systems and networks from unauthorized access and attacks. They are responsible for developing and implementing security measures to protect the confidentiality, integrity, and availability of data. If you want to protect computer systems and networks from unauthorized access and attacks, this course may be useful for you.
Technical Writer
Technical Writers create technical documentation for software and hardware products. They are responsible for ensuring that the documentation is clear, accurate, and easy to understand. If you want to create technical documentation for software and hardware products, this course may be useful for you.
Systems Administrator
Systems Administrators manage and maintain computer systems and networks. They are responsible for ensuring that the systems and networks are reliable, efficient, and secure. If you want to manage and maintain computer systems and networks, this course may be useful for you.
Software Developer
Software Developers design, build, and test software systems. They are responsible for ensuring the software is reliable, efficient, and meets the needs of the users. If you want to design, build, or test software systems, this course may be useful for you.
Software Architect
Software Architects design and develop the architecture of software systems. They are responsible for ensuring that the software system is scalable, reliable, and efficient. If you want to design and develop the architecture of software systems, this course may be useful for you.
Computer Programmer
Computer Programmers write code to implement software solutions. They are responsible for ensuring that the code is efficient, reliable, and meets the needs of the users. If you want to write code to implement software solutions, this course may be useful for you.
Database Developer
Database Developers design and develop databases. They are responsible for ensuring that the databases are scalable, reliable, and efficient. If you want to design and develop databases, this course may be useful for you.
Programmer Analyst
Programmer Analysts work with business and technical teams to analyze and design software solutions. They are responsible for ensuring that the software meets the needs of the business and is efficient and reliable. If you want to work with business and technical teams to analyze and design software solutions, this course may be useful for you.
Information Technology Project Manager
Information Technology Project Managers plan and manage the development and implementation of information technology systems. They are responsible for ensuring that the projects are completed on time, within budget, and to the required standards. If you want to plan and manage the development and implementation of information technology systems, this course may be useful for you.
Software Quality Assurance Tester
Software Quality Assurance Testers test software systems to find and fix bugs. They are responsible for ensuring that the software is reliable and meets the needs of the users. If you want to test software systems to find and fix bugs, this course may be useful for you.

Reading list

We've selected ten books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in C++ Standard Library: Associative Containers.
Is the definitive reference on the C++ programming language. Written by its creator, it provides comprehensive coverage of the language, including the latest updates in C++20. It's an essential resource for any serious C++ programmer.
Is the definitive reference on the C++ programming language. It covers a wide range of topics, from the basics of the language to advanced topics such as templates and concurrency. It valuable resource for anyone who wants to learn more about C++.
Comprehensive reference on the C++ Standard Library, covering both the basics and advanced topics. It valuable resource for anyone who wants to learn more about the C++ Standard Library.
Can be an insightful companion read in addition to the course. It thoroughly covers C++ data structures and algorithms so you can further develop the foundational concepts you learned in this course.
Comprehensive introduction to C++. It covers a wide range of topics, from the basics of the language to advanced topics such as templates and concurrency. It valuable resource for anyone who wants to learn more about C++.
Provides a deep dive into the C++ programming language and offers practical advice on how to write effective C++ code. It valuable resource for anyone who wants to improve their C++ programming skills.
Provides 50 specific ways to improve your use of the C++ Standard Template Library (STL). It covers a wide range of topics, from basic STL concepts to advanced techniques. It valuable resource for anyone who wants to learn more about the STL.
Provides a practical introduction to C++. It covers a wide range of topics, from the basics of the language to advanced topics such as templates and concurrency. It valuable resource for anyone who wants to learn more about C++.
Provides a quick reference to the C++ Standard Library. It covers a wide range of topics, from basic STL concepts to advanced techniques. It valuable resource for anyone who wants to learn more about the STL.
Provides a comprehensive introduction to concurrency in C++. It covers a wide range of topics, including threads, locks, and synchronization. It valuable resource for anyone who wants to learn more about concurrency in C++.

Share

Help others find this course page by sharing it with your friends and followers:
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser