Misconception: Students may think that assigning one array to point to another array makes a copy of that array, failing to make a distinction between shallow and deep copies.
Use group discussion to help students figure out boundary cases for removing duplicate adjacent elements on their own so that they get to discuss a variety of test cases in depth before focusing on the code.
Give students a fully functional program on Day 1 that they will incrementally add features to as you cover content throughout the semester to engage them by satisfying their desire for creating working code.
Have students code boundary condition test to handle removing adjacent duplicates to help them better understand data structures and become familiar with common bugs through practice.
Require students to refactor their code while keeping the output of their program exactly the same in order to challenge them to solve problems using a variety of strategies.
Foreshadow arrays right after teaching for loops by showing students how to create a 1x6 grid using the rectangle object in the Java objectdraw library because visualizations built off of recently introduced material provide a useful transition.
Reinforce that certain types in Python such as lists are mutable while others (e.g. strings, tuples) are not. Students have difficulty tracing code that uses mutable types because they often forget this.
Track the variable values of a recursive function using multiple pieces of paper to form a “stack” so that students can visualize what happens when a method calls itself and how each method call has its own unique variable values.
Use the “fence post” method when teaching Java’s substring method to help students use it accurately.