Please enable JavaScript to use CodeHS

Data Structures in C++

Description

In this lesson, students learn about pointers, a variable that holds a memory address. Pointers are one of the key concepts in learning programming and are used for implementing several data structures.

Objective

Students will be able to:

  • Declare a variable as a pointer using the dereference operator (*)
  • Assign a pointer to an existing memory address using the reference operator (&) and a new memory address using the new keyword
  • Declare and initialize pointers that point to data structures
  • Declare and initialize data structures that store pointers
  • Declare and call functions that take a pointer type as a parameter
  • Use the arrow operator (->) to methods through a pointer in lieu of using the dot operator (.)
Description

In this lesson, students learn about linked lists, a linear data structure in which elements are not stored next to each other in memory. Linked lists consist of nodes that each contain a data element and a pointer to the next node in the linked list.

Objective

Students will be able to:

  • Use object-oriented programming to implement the linked list data structure
  • Insert new nodes into a linked list
  • Traverse a linked list using a standard while loop
    traverse a linked list using recursion
Description

This lesson introduces students to the idea of graphs by using several examples and expanding on these examples. Graphs is a very broad topic and the lesson only scratches the surface of the topic.

Objective

Students will be able to:

  • Explain what graphs are and what they are used for
  • Make changes to existing graphs and customize the implementation
Description

In this lesson, students complete a summative assessment of the unit’s learning objectives.

Objective

Students will be able to:

  • Prove their knowledge of pointers, linked lists, and graphs through a multiple choice quiz