Simple play icon Course
Skills

Introduction to Data Structures and Algorithms in C++

by Giovanni Dicanio

This introductory course will teach you how to implement some fundamental data structures and algorithms in C++ from scratch, with a combination of theoretical introduction using slides, and practical C++ implementation code.

What you'll learn

Knowing some fundamental data structures and algorithms both in theory and from a practical implementation perspective helps you in being a better C++ programmer, gives you a good foundation to understand standard library’s containers and algorithms inner “under the hood” mechanics, and serves as a kind of knowledge that is required in several coding interviews, as well.

In this course, Introduction to Data Structures and Algorithms in C++, you’ll learn how to implement some fundamental data structures and algorithms in C++ from scratch, with a combination of theoretical introduction using slides, and practical C++ implementation code as well.

No prior data structure or algorithm theory knowledge is required. You only need a basic knowledge of C++ language features.

  • First, you'll discover how to develop a C++ class to safely use arrays, with automatic memory management using constructor and destructor, and safely accessing array elements with bounds checking.
  • Then, you’ll see how to further improve this array class, overloading the insertion operator to offer a simple nice idiomatic printing syntax for arrays, and optimizing the array class with move semantics.
  • You’ll also learn how to properly copy arrays, and you’ll see the copy-and-swap idiom in action.
  • Then, you’ll learn how to generalize the array class with templates.
  • Next, you’ll learn about the Big O notation in a practical intuitive way, and you’ll apply that knowledge to a couple of search algorithms.
  • You’ll start learning how to search using the simple linear search, and then you’ll see how to improve searching, using binary search. I’ll first introduce these algorithms using slides, and then you’ll see them in action in concrete C++ demo code.
  • Finally, you’ll discover how to implement other common data structures, like the stack with its LIFO policy and push and pop operations, and linked lists, including operations like list node insertion and removal, and searching elements in a linked list.
After completing this course, you will be able to implement some common fundamental data structures and algorithms from scratch in C++, you’ll have a practical understanding of the Big O notation to evaluate and compare algorithm performance trends, and you’ll see in action, several interesting C++ coding techniques that you’ll be able to reuse in your own C++ projects as well.

Moreover, you will be able to use this foundational knowledge to move forward to more advanced C++ data structures and algorithms topics.

Table of contents

Course Overview
2mins

About the author

Giovanni Dicanio is a computer programmer specialized in both cross-platform C and C++, and Windows operating system development. Giovanni wrote computer programming articles on C++, OpenGL and other programming subjects on Italian computer magazines. He recently authored some C++ feature articles for MSDN Magazine, too. He contributed code to some open-source projects as well. His computer programming experience dates back to the glorious Commodore 64 and Amiga 500 golden days, with Basic and a... more

Ready to upskill? Get started