Book Image

C++ Data Structures and Algorithm Design Principles

By : John Carey, Anil Achary, Shreyans Doshi, Payas Rajan
Book Image

C++ Data Structures and Algorithm Design Principles

By: John Carey, Anil Achary, Shreyans Doshi, Payas Rajan

Overview of this book

C++ is a mature multi-paradigm programming language that enables you to write high-level code with a high degree of control over the hardware. Today, significant parts of software infrastructure, including databases, browsers, multimedia frameworks, and GUI toolkits, are written in C++. This book starts by introducing C++ data structures and how to store data using linked lists, arrays, stacks, and queues. In later chapters, the book explains the basic algorithm design paradigms, such as the greedy approach and the divide-and-conquer approach, which are used to solve a large variety of computational problems. Finally, you will learn the advanced technique of dynamic programming to develop optimized implementations of several algorithms discussed in the book. By the end of this book, you will have learned how to implement standard data structures and algorithms in efficient and scalable C++ 14 code.
Table of Contents (11 chapters)

C++ Standard Library Tools for Divide and Conquer

In the previous section, we manually implemented the necessary functions for divide-and-conquer algorithms. However, the C++ standard library comes bundled with a large set of predefined functions that can save us a lot of work when programming. The following table provides a handy list of the most commonly used functions that are used while implementing algorithms that use the divide-and-conquer paradigm. We are briefly describing these functions for reference, but the detailed implementation is left out of the scope of this chapter for brevity. Feel free to explore more about these functions; you should be able to understand them based on the concepts we've covered in this chapter:

Figure 4.20: Some useful STL functions for algorithms
Figure 4.20: Some useful STL functions for algorithms