Section Four: Algorithms Flashcards
1
Q
Decomposition
A
Breaking a complex problem down into smaller problems and solving each one individually
2
Q
Abstraction
A
Picking out the important bits of information from the problem, ignoring the specific details that don’t matter
3
Q
Algorithmic thinking
A
A logical way of getting from the problem to the solution. If the steps you take to solve a problem follow an algorithm then they can be reused and adapted to solve similar problems in the future.
4
Q
Binary Search Algorithm
A
- Find the middle item in the ordered list
- If this is the item you’re looking for, then stop the search - you’ve found it
- If not, compare the item you’re looking for to the middle item. If it comes before the middle item, get rid of the second half of the list. If it comes after the middle item, get rid of the first half of the list
- You’ll be left with a list that is half the size of the original list. Repeat steps 1 - 3 on this smaller list to get an even smaller one. Repeat until you find the desired item.