

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Welcome to Data Structures and Algorithms
incomplete
2: Find Minimum
incomplete
3: Simple Algorithms
incomplete
4: What Is an Algorithm?
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
In computer science, an algorithm is a finite sequence of well-defined, computer-implementable instructions. In short, an algorithm is:
Defined: there is a specific sequence of steps that performs a task
Unambiguous: there is a "correct" and "incorrect" interpretation of the steps
Implementable: it can be executed using software and hardware
Algorithms are usually written in "pseudocode" (pronounced "sue-dough-code") because an algorithm is a higher-level description of a solution to a problem. An algorithm doesn't care if it's implemented in Python, Go, TypeScript, or (gasp) Java. Pseudocode is just plain English that describes the steps of the algorithm.
Here's some pseudocode for a mystery algorithm:
Start with an original string called S and a new empty string called R.
Loop through S from its last character to its first character, and for each one, add it to the end of R.
Once you've processed all the characters, return R.