2.1 Algorithms Flashcards
What are the 3 principles of computational thinking?
- Decomposition
- Abstraction
- Algorithmic thinking
What is an algorithm?
A sequence of instructions that perform a specific task when followed.
What does decomposition mean?
Breaking down a large problem into smaller ones that can be solved individually.
What does abstraction mean?
picking out the important piece of information and ignoring the details that don’t matter
What does algorithmic thinking mean?
A logical way from getting from the problem to the solution.
What does the rounded rectangle mean in a flowchart?
Start/stop
What does the parallelogram mean in a flowchart?
input/output
What does the rectangle mean in a flowchart?
processes - general instruction, processes and calculations
What does the diamond mean in a flowchart?
Decisions (yes and no)
What does the arrow show in a flowchart?
The direction of the flowchart.
What is a sub program?
Makes reference to another flowchart.
What are the 2 types of searching algorithms?
Binary and linear search.
What are the steps of linear search?
1) look at the first item in the unordered list
2) If that is the requested item then stop
3) if not look at the next item
4) repeat until you find the requested item in the list.
What are the steps of binary search?
1) find the middle value
2) if that is the item then stop
3) if not then compare the item that you are looking for to the middle one and get rid of the irrelevant side.
4) do this until the item is found.
In order to do a binary search, what does the list need to be?
The list has to be ordered