Activity Card - Optimize Nested Loops
Optimize Nested Loops
Objective: Students will optimize nested loops for better performance.
Instructions:
- Provide programs with inefficient nested loops.
- Students rewrite the loops to reduce unnecessary iterations.
- Compare the performance of the original and optimized versions.
Materials:
- Inefficient loop programs
- Optimization guidelines
Assessment:
- Ability to optimize loops
- Understanding of performance improvements