2.1 Flashcards
What is abstraction?
Picking out important bits of information/details from the problem, ignoring the specific details that don’t matter
What is algorithmic thinking?
Logical thinking and thinking methodically
What is decomposition?
Breaking a complex problem down into smaller problems and solving each one individually
How do you write pseudocode? What are some ways you should write it
Write what you have to do in words but simply just important details. Variable = input"..." If...then Else Print
What does a oval mean in flow diagrams?
Start/stop
What does a parallelogram mean in a flow chart?
Input/output
What does a rectangle stand for in flow diagrams?
Processes -general instructions, processes and calculations
What does a diamond mean in a flow diagram?
Decision -yes or no
What does an arrow show in a flow diagram?
Show the direction you should follow
What’s an algorithm?
A precise sequence of instructions.
What’s computational thinking?
Computational thinking allows us to take a complex problem, understand what the problem is and develop solutions.
What’s linear search?
- Look at the first item in the list
- if this is the item you’re looking for stop
- if not carry on to the next item in the list
- repeat the 2 steps before until you find the item you were looking for or you’ve checked every item
What’s binary search?
- find the middle item in the ORDERED list
- if this is the item you’re looking for then stop the search
- if not then if your item is lower than the middle item you get rid of the second half of the list if it comes after the middle item you get rid of the first half of the list
- you’re left with a list half the size then repeat the 3 steps before and keep going until you find what you’re looking for
What’s the pros and cons of linear search?
Pros
-fairly simple to code
-the data does need to be in a set order
Cons
-slow to process large lists-worst case scenario is searching through the whole list
-not efficient, only works well with small lists
What’s the pros and cons of binary search?
Pros -more efficient -more suitable for larger lists Cons -list has to be ordered -more complicated to code