Classification of Algorithms Flashcards
What is abstraction?
The process of making a problem simpler by removing or hiding features.
What is representational abstraction?
what remains after unnecessary details are removed e.g. the London underground map in which geographical details are all hidden.
what is generalisation abstraction?
identifying key features of a problem to identify the problem as a more general set of problems.
How does OOP implement information hiding?
a class encapsulates all of its private attributes and methods which are exposed only through its interface which could be the public methods.
What is procedural abstraction?
ensures that subroutines are as generalised and as re-usable as possible.
- using a more general subroutine name
-splitting the user interface and processing of data into separate subroutines.
What is functional abstraction?
aims to hide the complexity of an algorithm or how a part of the program works using subroutines.
What is data abstraction?
allows you to separate how a complex data structure is used from how it is constructed.
What is problem reduction?
removing unnecessary detail from a problem to reduce the problem to one that has already been solved.
What is decomposition?
Breaking a large problem into smaller sub problems.
What is composition?
combining parts of a solution together to form a solution made up of component part
Automation
Designing, implementing and executing a solution to solve a problem automatically.
done by
- Implementing the data structures to store the data
- Implementing the algorithms to process the data
Time wise complexity
algorithms that have a lot of steps or comparisons will take longer to compute
Space wise complexity
algorithms that store a lot of temporary values while the processes take place will take up a lot of memory
Example of constant time O(1)
- finding the first item in a list
- jumping straight to a value at a given index
Example Logarithmic time O(logn)
Binary search
takes very little time because the possible list of remaining values os halved each time