Topic 5 Flashcards
What is decomposition?
Breaking a complex problem, down into smaller problems and solving each one individually
What is abstraction?
Taking out the important bits of information from the problem, ignoring specific details that don’t matter
What is algorithmic thinking?
A logical way of getting from a problem to a solution. If the steps you take to solve follow an algorithm you it can be reused and adapt to solve similar problems in the future.
What does an oval mean in a flow chart
Start/end
What is a parallelogram box mean in a flowchart
Input/output
What does a box mean in a flowchart?
General, instructions, processes and calculations
What does a diamond box mean in a flowchart?
A decision
What is a box inside a box mean in a flowchart
Subprogram
What is the arrow show in a flowchart?
Arrows connect the boxes and show the direction you should follow
Conditions for a binary search
List must be ordered
Process of a binary search
Find the middle term in your ordered list
If this is your item then stop
If not compare with the item, you’re looking for, if the middle term comes before get rid of second half and vice versa
You’ll be left for the last half the size of the original list. Repeat steps one to 3 until you find the item.
What can a linear search be used on?
Unordered list
Process for linear search
Look at the first item in the unordered list
If this is your items in stop
Then look at the next item in the list
Repeat steps 2 to 3 until you’ve checked every item or found the one you’re looking for
Advantages of binary search
Faster
Takes fewer steps
Advantages of linear
Simple
Can be done on any type of list