Stacks

CS2 / C++

Authors

  • Kevin Wortman California State University - Fullerton

Abstract

The activity introduces the stack data structure. Students invent a visual sketch notation for stacks; the terminology of top, push, and pop; and LIFO order. Students compare the implementation strategy of placing the top element at the beginning of an array against placing the bottom element at the beginning. They apply prerequisite big-O analysis skills to compare the efficiency of these strategies and make an evidence-based decision about which strategy is superior. In an exercise, students may perform the same kind of comparison between a singly-linked list with the top at the beginning or bottom at the beginning.

This activity was developed with NSF support through IUSE-1626765. You may request access to this activity via the following link: IntroCS-POGIL Activity Writing Program

  • Level: Undergraduate
  • Setting: Classroom
  • Type: Learning Cycle
  • Discipline: Computer Science
  • Course: CS2 / C++
  • Keywords: stack, LIFO order, push, pop, singly-linked list

Downloads

Published

2023-01-09

How to Cite

Wortman, K. (2023). Stacks: CS2 / C++. POGIL Activity Clearinghouse, 3(4). Retrieved from https://pac.pogil.org/index.php/pac/article/view/286

Issue

Section

CS-POGIL Activity Writing Program