2.2.2 Computational Methods Flashcards
What is a computable problem?
A problem that can be solved with an algorithm.
What are three limiting factors to computable problems?
Processing power, speed and memory.
What is problem decomposition?
Breaking a clearly defined problem into smaller subproblems, until each subproblem can be represented as a self contained subroutine.
How does decomposition save time?
Programmers may find certain sections of the program that can be implemented using precoded modules or libraries.
How does decomposition make a project easier to manage?
Different developer teams can be assigned separate sections of the code according to their specialisms. These can be individually designed, developed and tested before being combined to produce a working piece of software at the end.
How does decomposition make debugging simpler and less time consuming?
It is easier to identify and fix errors in individual modules, compared to an entire application.
What is divide and conquer?
A problem solving technique.
Describe the three stages of Divide and Conquer.
- Divide: The size of the problem is halved with every iteration.
- Conquer: Each individual problem is solved, often recursively.
- Merge: The solutions to the sub problems are combined to form the final solution to the problem.
What three algorithms use the divide and conquer approach
Binary Search
Quick Sort
Merge Sort
Advantage of using Divide and Conquer
The size of the problem halves with each iteration, which greatly simplfies very complex problems. This means that as the size of the problem grows, the time taken to solve it will not grow as significantly.
Disadvantage of using Divide and Conquer
- Possiblity of stack overflow.
- Large programs are very difficult to trace
Representational abstraction
Excessive details are removed to simplify a problem
Benefit of abstraction
Allows programmers to focus on the core aspects required of the solution, rather than worrying about unnecessary details.
How can using levels of abstraction benefit a large complex project?
The large project can be split into smaller component parts.
Abstraction by generalisation
Groups together different sections of the problem with similar underlying functionality. This allows for segments to be coded together and reused, so it saves time.
What is backtracking?
A problem solving technique implemented using algorithms, often recursively.