2.1 Algorithms Flashcards
Whats computational thinking
About the steps taken to find a solution to a complex problem.
It involves decomposition, abstraction and algorithmic thinking
Whats decomposition?
Breaking down a complex problem into smaller problems and solving each oke individually
Whats abstraction?
Picking out important bits of information from a problem and ignoring those that don’t matter
Whats algorithmic thinking
A logical way of solving a problem.
Whats pseudocode
Not an actual programming language.
It shows the steps of the algorithm without the need to follow syntax.
In a flow chart, what shape do you use for a start/stop
Oval
In a flow chart, what shape do you use for an input/output
A slanted rhombus
_
/_/
In a flow chart, what shape do you use for a process/calculation
Rectangle
In a flow chart, what shape do you use for a decision
Diamond
Whats a linear search? Does it need to be ordered?
Unordered list. Checks each item in a list in turn and stops when it finds the item its looking for or gets to the end of the list
Whats a binary search? Does it need to be ordered?
Ordered list. It looks at the middle term, if its a match then the search ends. If the desired item is less then middle term then repeat in the bottom half, otherwise look at the top half and repeat until found or no more items to look at
Whats a bubble sort
Compares pairs of items and puts them in order.
Its simple but can take a few run throughs
Whats a merge sort
Splits a list apart into individual items then merges it back together.
Much more efficient than bubble sort for larger lists
Whats an insertion sort
Orders items as it goes through.
It’s a simple algorithm and works very well with small lists. Inefficient for longer lists