We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Welcome to Data Structures and Algorithms

The terms "data structures" and "algorithms" (DSA) were designed to scare young CS students into eating their vegetables. But after this course, you'll see there's nothing to fear.

An "algorithm" is just a set of instructions for solving a problem. Here's a simple one for adding two numbers:

  1. Start with input variables a and b
  2. Add a and b using the + operator, and assign the result to a new variable, total
  3. Return the total variable

Data structures are just organizational tools that let you write more advanced algorithms... more on them later.

Assignment

Complete the add algorithm function on the right. It should return the sum of a and b.