Algorithms Paper 2 Flashcards
What is an algorithm
A series of steps that can be followed to complete a task
Example of non computer algorithm
Recipe
What is decomposition
Breaking a problem down into smaller simpler steps
What is an example of decomposition and why
Algorithms
Break a problem into a series of small steps
What is abstraction
General definition
Computer science definition
Removing detail
Focussing on the important information only and ignoring irrelevant detail
Example of abstraction
Abstract artwork
Why do we need abstraction
Removing detail makes things easier to understand ie a map
Example of abstraction in programming
Subroutine
Linear search definition
Simplest method of searching for data but it is slow / inefficient
Explain process of linear search
Starts at beginning of data set and looks at each piece of data in turn until the data is found (or reaches the end)
Advantages of linear search
Simple
Data set doesn’t need to be in order
Disadvantages of linear search
Inefficient and slow
Binary search definition
Breaking a data set in half (two pieces)
This divide and conquer method of searching is more efficient than linear search but only works if the data is sorted into order first
Which type of searching technique is faster
Binary search is faster
Linear search is slower
Advantages of binary search
More efficient / faster