Please enable JavaScript.
Coggle requires JavaScript to display documents.
Algorithm - Coggle Diagram
Algorithm
Tips
understand the problem, after choose algorithm
clear problem statement
Algorithm you have define steps and produce a result
Algorithm guideline
Should actually complete and not take an infinite amount of time
Clearly defined problem statement, input, and output.
The steps in the algorithm need to be in a very specific order.
The steps also need to be distinct.
the algorithm should produce a result
Two concepts
Correctness
Efficiency
Time Complexity
how long time to run algorithm
Big O
O(n)
Order of magnitude of complexity
A function of the size
Upper Bounds measure algorithm in worst case scenario
Linear time
Linear search = O(n)
Binary search O(log n)
O(1) constant time
inverse of expoent is logarithm
O(log n) logarithmic runtime
O(n²) Quadratic time
Cubic time
O(n log n) Quasilinear time
Sorting algorithm, Merge sort
O(n^k) Polynomial Runtime
O(Xn)
Inefficient algorithm
Brute force have exponential runtimes
Traveling Salesman
Factorial/Combinatorial n!
O(n!)
Space Complexity
amount of memory take to compute
Definitions
Algorithimic thinking= understand the problem
Algorithm = A set of steps or instructions for completing a task.
Linear search algorithm = check current match the search and move forward sequentialy