Zusammenfassung der Ressource
GCSE Computer Science: Algorithms
- Representing
Algs
- Pseudocode
- Flowcharts
- Inputs
Processes
Outputs
- Sequence
Selection
Iteration
- Efficiency
- One problem ->
many algorithms
- eg Bubble
Merge Quick
sorts
- Time
- Different algs give
same result
- Fast or slow?
- Searching
Algs
- Linear
- Binary
- Sorting
Algs
- Bubble
- Merge
Anmerkungen:
- MergeSort (Array(First..Last))
Begin
If Array contains only one element Then
Return Array
Else
Middle= ((Last + First)/2) rounded down to the nearest integer
LeftHalfArray = MergeSort(Array(First..Middle))
RightHalfArray = MergeSort(Array(Middle+1..Last))
ResultArray = Merge(LeftHalfArray, RightHalfArray)
Return ResultArray
EndIf
End MergeSort
- Definitions
- Decomposition
- breaking a problem into a number of
sub-problems, so that each sub- problem
accomplishes an identifiable task
- Abstraction
- the process of removing
unnecessary detail from a
problem
- Algorithm
- A sequence of instructions to complete a task
in a finite amount of time