Lists Review and Performance : 03/31/2023
Linked Lists : 03/30/2023
Algorithms and Lists : 03/29/2023
Lambda Expressions : 03/24/2023
Anonymous Classes : 03/23/2023
Practice with Interfaces : 03/22/2023
Implementing Interfaces : 03/21/2023
Using Interfaces : 03/20/2023
Working with Exceptions : 03/10/2023
Throwing Exceptions : 03/09/2023
Catching Exceptions : 03/08/2023
References and Polymorphism : 03/07/2023
References : 03/06/2023
Data Modeling 2 : 03/03/2023
Equality and Object Copying : 03/02/2023
Polymorphism : 03/01/2023
Inheritance : 02/28/2023
Data Modeling 1 : 02/27/2023
Companion Objects : 02/24/2023
Encapsulation : 02/23/2023
Constructors : 02/22/2023
Objects, Continued : 02/21/2023
Introduction to Objects : 02/20/2023
Compilation and Immutability : 02/17/2023
Practice with Collections : 02/16/2023
Maps and Sets : 02/15/2023
Lists and Type Parameters : 02/14/2023
Imports and Libraries : 02/13/2023
Multidimensional Arrays : 02/10/2023
Practice with Strings : 02/09/2023
null : 02/08/2023
Algorithms and Strings : 02/07/2023
Strings : 02/06/2023
Functions and Algorithms : 02/03/2023
Practice with Functions : 02/02/2023
More About Functions : 02/01/2023
Errors and Debugging : 01/31/2023
Functions : 01/30/2023
Practice with Loops and Algorithms : 01/27/2023
Algorithms : 01/26/2023
Loops : 01/25/2023
Arrays : 01/24/2023
Compound Conditionals : 01/23/2023
Conditional Expressions and Statements : 01/20/2023
Operations on Variables : 01/19/2023
Variables and Types : 01/18/2023
Welcome to CS 124 : 01/17/2023
Functions and Algorithms
Functions are so important that we’re going to continue getting more practice with them.
We’ll also discuss the connection between functions and algorithms, the conceptual heart of computer science.
Throughout this lesson we’ll return to bits of code that we previous implemented as snippets and reimplement them as methods.
We’ll also use this as a chance to reinforce some important programming patterns that we’ve already been using.
But let’s start with some debugging practice!
Next, let’s revisit the code we wrote for array search, rewrite it is a method, and then test it using some sample inputs.
Our next practice problem has a tricky loop setup.
Let’s review that together, and then you can attempt the problem itself.
Now, let’s revisit the code we wrote for array sum, rewrite it is a method, and then test it using some sample inputs.
As a bit of homework preparation support, let’s talk through how to approach this lesson’s homework problem, since it has another interesting loop setup.
We’ll also demonstrate how we can modify the values of arrays that are passed to methods.
And we’ll provide practice with a variant of the problem that you need to complete for today’s homework.
More Practice
Need more practice? Head over to the practice page.