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

C++ Standard Library

Sequential Containers

Giovanni Dicanio

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

Read more

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

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. 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, you’ll learn how to simply reuse that treasure in your own C++ applications.

In particular, you’ll learn about std::vector, which is a flexible dynamic array, that should be the default container of choice in many contexts in C++ applications. You’ll enjoy the automatic resource management (for both memory resources and non-memory ones) offered by std::vector, which will help you develop both efficient and safer C++ code. You’ll also see how convenient is for example to grow a vector, still keeping the contiguous memory layout requirement for its elements.

You’ll also learn about important operations, like inserting, removing and searching elements, using both C++ container methods and Standard Library’s algorithms. In fact, C++ standard containers and algorithms are kind of like “bread and butter”, and you can do great things using both. You don’t need to have any previous experience with the C++ Standard Library, as I’ll teach you its great and flexible design based on containers, algorithms and iterators, and you’ll see how containers are wired with algorithms using iterators, and how you can reuse the same algorithms with different containers.

You’ll also learn that in some specific cases you can use a zero-overhead standard container that wraps fixed-size C-style arrays in a convenient high-level safe C++ interface: it’s std::array. I’ll compare and contrast it against std::vector, and you’ll learn pros and cons of each one.

You’ll also learn how to use the std::list container, if you need a high-level C++ abstraction based on the doubly-linked list data structure. Moreover, seeing the same algorithms used with different containers will also work very well as a reinforcement learning experience for you. I’ll also show you some subtle bugs, that are especially frequent in those starting learning the C++ Standard Library’s containers, and how to fix them. I hope this will save you time and headache during your C++ programming.

To proficiently follow this course, you only need a basic knowledge of C++ language features.

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

Enroll now

What's inside

Syllabus

Course Overview
Storing Sequences of Elements with the Standard std::vector Container
Breaking the Ice with Useful Standard Algorithms: Sorting std::vector
Read more
Inserting, Removing, and Searching Elements
Safely Encapsulating Fixed-size Arrays with std::array
Managing Linked-lists with std::list

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Develops professional skills or deep expertise in basic use of C++ containers
Examines C++ containers, which are standard in industry, practice, and academia
Builds a strong foundation for beginners in using C++ containers
Covers common operations of C++ containers, such as inserting, removing, and searching items, which are core skills for using C++ containers
Taught by Giovanni Dicanio, who are recognized for their work in C++

Save this course

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

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in C++ Standard Library: Sequential Containers with these activities:
Seek guidance from an experienced C++ programmer
Gain valuable insights and accelerate progress by learning from someone with expertise in vector usage
Show steps
  • Identify potential mentors through professional networks, online forums, or your institution
  • Reach out to potential mentors and request guidance on vector concepts
Review introduction to C++ vectors
Reinforce concepts about vectors learned in prior coursework
Show steps
  • Refresh your understanding of the basic syntax and operations of vectors
  • Practice working with vectors in a sandbox environment, such as an online compiler
Join or create a study group for vector discussions
Collaborate with peers to enhance comprehension and identify areas for improvement
Show steps
  • Find or create a study group with other students taking the same course
  • Meet regularly to discuss vector concepts, share understanding, and work through problems together
Five other activities
Expand to see all activities and additional details
Show all eight activities
Follow tutorials on advanced features of std::vector
Expand knowledge of vector capabilities and their use in complex scenarios
Show steps
  • Identify specific advanced vector features you want to learn, such as iterators, capacity management, or memory allocation
  • Search for and select high-quality tutorials that cover these topics
  • Follow the tutorials step-by-step, implementing the code examples and experimenting with different scenarios
Review 'The C++ Standard Library: A Tutorial and Reference'
Expand knowledge of C++ Standard Library and reinforce vector concepts
Show steps
  • Read and study the chapters related to vectors and Standard Library containers
  • Work through the exercises and examples to enhance your comprehension
Solve coding exercises involving vector manipulations
Foster application of vector concepts through practical problem-solving
Show steps
  • Find online coding platforms or resources that offer vector-related exercises
  • Solve the exercises, debugging your code and refining your understanding of vector operations
  • Review solutions and compare your approaches with others to learn alternative techniques
Create a blog post or video tutorial on a specific vector topic
Solidify your understanding by explaining vector concepts to others
Show steps
  • Choose a specific vector topic that you want to focus on, such as iterators or memory management
  • Research the topic thoroughly, gathering information from reliable sources
  • Write a clear and concise blog post or create a video tutorial explaining the topic
  • Share your content with others and encourage feedback, refining your understanding through the process
Develop a small program that utilizes vectors to solve a specific problem
Apply vector concepts in a practical scenario, fostering problem-solving skills
Show steps
  • Identify a problem that can be solved using vectors, such as data analysis or text processing
  • Design and implement a solution using vectors to store and manipulate the necessary data
  • Test and refine your program, ensuring its functionality and efficiency

Career center

Learners who complete C++ Standard Library: Sequential Containers will develop knowledge and skills that may be useful to these careers:
Data Scientist
Data Scientists use data to make informed decisions. They collect, clean, and analyze data to identify trends and patterns. They may also use statistical techniques to develop models and forecasts. The C++ Standard Library's Sequential Containers course can help Data Scientists by providing them with the skills to manage and analyze large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills are essential for Data Scientists who need to be able to quickly and efficiently process large amounts of data.
Machine Learning Engineer
Machine Learning Engineers design and build machine learning models. They work with data scientists and other stakeholders to develop and deploy machine learning solutions. The C++ Standard Library's Sequential Containers course can help Machine Learning Engineers by providing them with the skills to manage and process large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills are essential for Machine Learning Engineers who need to be able to quickly and efficiently process large amounts of data.
Data Engineer
Data Engineers design, build, and maintain the infrastructure that stores and processes data. They work with data scientists and other stakeholders to ensure that data is available and accessible for analysis. The C++ Standard Library's Sequential Containers course can help Data Engineers by providing them with the skills to manage and process large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills are essential for Data Engineers who need to be able to quickly and efficiently process large amounts of data.
Quantitative Analyst
Quantitative Analysts use mathematical and statistical techniques to analyze financial data. They develop models and forecasts to help investors make informed decisions. The C++ Standard Library's Sequential Containers course can help Quantitative Analysts by providing them with the skills to manage and process large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills are essential for Quantitative Analysts who need to be able to quickly and efficiently process large amounts of data.
Actuary
Actuaries use mathematical and statistical techniques to assess risk and uncertainty. They work in a variety of fields, including insurance, finance, and healthcare. The C++ Standard Library's Sequential Containers course can help Actuaries by providing them with the skills to manage and process large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills are essential for Actuaries who need to be able to quickly and efficiently process large amounts of data.
Computer Scientist
Computer Scientists research and develop new computing technologies. They work in a variety of fields, including artificial intelligence, machine learning, and data science. The C++ Standard Library's Sequential Containers course can help Computer Scientists by providing them with the skills to manage and process large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills are essential for Computer Scientists who need to be able to quickly and efficiently process large amounts of data.
Operations Research Analyst
Operations Research Analysts use mathematical and analytical techniques to solve problems in a variety of fields, including logistics, manufacturing, and healthcare. The C++ Standard Library's Sequential Containers course can help Operations Research Analysts by providing them with the skills to manage and process large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills are essential for Operations Research Analysts who need to be able to quickly and efficiently process large amounts of data.
Data Architect
Data Architects design and build data management systems. They work with stakeholders to determine data requirements and then design and implement data solutions. The C++ Standard Library's Sequential Containers course can help Data Architects by providing them with the skills to manage and process large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills are essential for Data Architects who need to be able to quickly and efficiently process large amounts of data.
Software Engineer
Software Engineers design, develop, and maintain software applications. They work with users to gather requirements and then design and implement software solutions. The C++ Standard Library's Sequential Containers course can help Software Engineers by providing them with the skills to manage and process large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills are essential for Software Engineers who need to be able to quickly and efficiently process large amounts of data.
Data Analyst
Data Analysts use data to make informed decisions. They collect, clean, and analyze data to identify trends and patterns. They may also use statistical techniques to develop models and forecasts. The C++ Standard Library's Sequential Containers course can help Data Analysts by providing them with the skills to manage and analyze large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills are essential for Data Analysts who need to be able to quickly and efficiently process large amounts of data.
Database Administrator
Database Administrators ensure that databases are running smoothly and efficiently. They also work with users to design and implement database systems. The C++ Standard Library's Sequential Containers course can help Database Administrators by providing them with the skills to manage and process large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills are essential for Database Administrators who need to be able to quickly and efficiently process large amounts of data.
Business Analyst
Business Analysts use data to make informed decisions. They collect, clean, and analyze data to identify trends and patterns. They may also use statistical techniques to develop models and forecasts. The C++ Standard Library's Sequential Containers course may be useful for Business Analysts who need to manage and analyze large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills can be helpful for Business Analysts who need to be able to quickly and efficiently process large amounts of data.
Market Researcher
Market Researchers gather data about consumers and markets. They use this data to develop marketing strategies and campaigns. The C++ Standard Library's Sequential Containers course may be useful for Market Researchers who need to manage and analyze large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills can be helpful for Market Researchers who need to be able to quickly and efficiently process large amounts of data.
Statistician
Statisticians use data to make informed decisions. They collect, clean, and analyze data to identify trends and patterns. They may also use statistical techniques to develop models and forecasts. The C++ Standard Library's Sequential Containers course may be useful for Statisticians who need to manage and analyze large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills can be helpful for Statisticians who need to be able to quickly and efficiently process large amounts of data.
Financial Analyst
Financial Analysts use data to make informed decisions about investments. They collect, clean, and analyze data to identify trends and patterns. They may also use statistical techniques to develop models and forecasts. The C++ Standard Library's Sequential Containers course may be useful for Financial Analysts who need to manage and analyze large datasets efficiently. The course covers topics such as sorting, searching, and inserting elements into containers. These skills can be helpful for Financial Analysts who need to be able to quickly and efficiently process large amounts of data.

Reading list

We've selected eight 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: Sequential Containers.
Provides a comprehensive overview of the C++ Standard Library, including a detailed description of the containers covered in this course.
Is the definitive reference on the C++ programming language, and it includes a detailed description of the Standard Library.
Provides a collection of challenging programming problems that can help you improve your understanding of C++.
Provides a quick reference to the Standard Library, including the containers covered in this course.
Provides a comprehensive guide to C++ templates, which are used extensively in the Standard Library.
Provides a deep dive into modern C++ programming techniques, including how to use the Standard Library effectively.

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