Activity 01
Pair Programming: Stack Reversal
Pairs implement a stack using an array with push and pop methods. They input a string, push characters, then pop to reverse it, handling edge cases like empty strings. Pairs test multiple inputs and swap code for peer review.
Design an algorithm that uses a stack to reverse a string.
Facilitation TipDuring Pair Programming: Stack Reversal, encourage students to swap roles every two operations to keep both partners engaged in the logic.
What to look forPresent students with a sequence of operations for both a stack and a queue (e.g., push A, push B, pop, enqueue C, dequeue). Ask them to trace the state of each data structure after each operation and record the final output.