Zusammenfassung der Ressource
2.1 - Algorithms
- Types of sorts
- Insertion
- You have one ordered list and a
selection of other elements.
- Take one element at a time and
compare it to the ordered list, and
place in correct position.
- REPEAT
- Bubble
- Moving through a list repeatedly,
swapping elements that are in
the wrong order. Can take a long time to do.
- Take first 2 elements and
compare.
- Put in order and compare the second with the third.
- REPEAT until all of the list is checked with no changes.
- Merge
- Option A
- Option B
- Flowchart Symbols
- Keywords
- Flowchart
- A diagram showing inputs, outputs
and processes in algorithms.
- Pseudocode
- Simplified programming code that isn't
programming language specific that is
used to design algorithms.
- Algorithms
- A series of steps to solve a
problem or perform an action.
- Dry Run
- Walking through an algorithm which
samples data, running each step
manually.
- Trace Table
- A table that follows the values of
variables to check for accuracy.
- Abstraction
- Getting rid of irrelevant detail and only
focusing on the important elements.
- Pattern recognition
- Where you see where you can
copy and paste similar code to
save time and debugging.
- Completing and Correcting algorithms
- Correcting
- Ensure you know what the algorithm should do.
- Separate into smaller chunks and draft the steps that should occur.
- Read through the
algorithm and compare
to your notes and
correct the algorithm
where they differ.
- Completing
- May be asked to fill in elements or
just continue the algorithm.
- Follow the same steps as
correcting, but complete at
the end, rather than correct.
- Linear & Binary Search
- Does it need to be ordered?
- BINARY: Yes
- LINEAR: No
- Long search?
- BINARY: At worst, half of
values are checked.
- LINEAR: All values may
have to be checked.
- Complex?
- BINARY: Longer and more complex to write.
- LINEAR: Simpler to write.