Mind map
Algorithms
Map content
Algorithms
Abstraction
- Focussing on what is important and relevant in problem solving and removing unnecessary details
Search algorithms
- Binary search
- Splits the array in half for middle item. If the desired item is below the middle item, eliminate that half and repeat the process with what is left of the array.
- Cons: Dataset must be sorted
- Pros: More efficient than linear search
- Splits the array in half for middle item. If the desired item is below the middle item, eliminate that half and repeat the process with what is left of the array.
- Linear search
- Each item is checked in order and once the desired item is found, it is returned.
- Pros: Easy to implement.
- Cons: Slow on a big array
- Each item is checked in order and once the desired item is found, it is returned.
- Binary search
Pseudocode
- A way to write out algorithms using code like statements that are used to plan algorithms.
Decomposition
- Breaking a more complex problem into smaller more manageable sub-problems.
Sort algorithms
- Bubble sort
- Compare the first two items in a data set and if they are in the wrong order, swap them. Repeat through all items and repeat until an iteration (reach the end of the data set) goes by where there are no swaps. This final pass shows that the list has been correctly ordered
- Pros: Require little space and easy to implement.
- Cons: Not very efficient.
- Compare the first two items in a data set and if they are in the wrong order, swap them. Repeat through all items and repeat until an iteration (reach the end of the data set) goes by where there are no swaps. This final pass shows that the list has been correctly ordered
- Insertion sort
- Compare the second item to the first and swap if needed. Compare the next to all items on its left and fit where needed, continue this with the rest of the array until sorted.
- Cons: Not very efficient.
- Pros: Little memory used and easy to implement.
- Compare the second item to the first and swap if needed. Compare the next to all items on its left and fit where needed, continue this with the rest of the array until sorted.
- Merge sort
- Split lists into list of one size. Merge each pair of sublists. Continue merging until there is only one list.
- Pros: Very efficient.
- Cons: Can be slower for smaller lists and require additional memory.
- Split lists into list of one size. Merge each pair of sublists. Continue merging until there is only one list.
- Bubble sort
Flow diagrams
- Used to visually represent the steps that make up an algorithm.
Information
- Description
- Mind Map on Algorithms, created by Ifsah Hussain on 27/02/2019.
- Created by
- Ifsah Hussain
- Views
- 0
- Rating