2.1 Algorithms Flashcards
Computational Thinking
steps taken to find a solution to a complex problem. It involves Decomposition, Abstraction and Algorithmic Thinking.
Decomposition:
Decomposition is breaking down a complex problem down into smaller problems and solving each one individually.
Abstraction:
picking out the important bits of information from the problem and ignoring the specific details that don’t matter.
Algorithmic Thinking:
logical
way of getting from a problem to a solution. If the steps you take follow an algorithm, this can be used again in the future.
Pseudocode:
not an actual programming language, it shows the steps of the algorithm without the need to follow syntax. It can easily be followed by a coder.
Flowcharts:
Algorithms can be shown using a flowchart. Flowcharts use different shaped boxes for different commands.
Search algorithm:
Computers follow a search algorithm to find items in a list e.g. searching a shopping website, searching for appointments at a doctor’s surgery.
Binary search:
Binary Search looks for items in an ordered list. The list can contain letters, numbers or alphanumeric characters
Linear search:
can be used on an
unordered list. This type of search checks each item in turn and stops when it finds the item or reaches the end of the list. Starts at start
Sorting algorithm:
follow a sorting algorithm to sort items in a list
e.g. sorting a list of names in Excel, shopping website – sorting a list from lowest to highest price.
Bubble sort:
Compares pairs of items. Very simple but can take a long time to sort large lists
Merge sort:
splits the list apart then merges if back together. This is a much more efficient than the bubble sort for large lists but is slower for smaller lists.
Insertion sort:
orders the items as it goes. The Insertion Sort is a simple algorithm and works very well with small lists. It is not very efficient for larger lists.
Advantages of high level compared to low level:
High level languages are easier to read and understand as similar to normal English so quicker to read, write and understand
Also the same high level code can be run with different processors, low level languages would be specific to one processor
Algorithm:
Sequence of instructions that perform a specific task when followed