Appendix

About

This section is included to assist the students to perform the activities in the book. It includes detailed steps that are to be performed by the students to achieve the objectives of the activities.

Chapter 1: Lists, Stacks, and Queues

Activity 1: Implementing a Song Playlist

In this activity, we will implement a tweaked version of a doubly linked list which can be used to store a song playlist and supports the necessary functions. Follow these steps to complete the activity:

  1. Let's first include the header and write the node structure with the required data members:

    #include <iostream>

    template <typename T>

    struct cir_list_node

    {

        T* data;

        cir_list_node *next, *prev;

        

    ~cir_list_node()

        {

            delete data;

        } ...

Get C++ Data Structures and Algorithm Design Principles now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.