filmov
tv
Big O, Math, Logarithms, Heap, Binary Tree, and Computing Explained with Simple Live Example
Показать описание
This live demonstration shows:
1) A real life example of logarithms, applied to computing. This is great for mathematicians who are looking for a true example.
2) Said another way, an example of how math can be used to explain/demonstrate computing concepts.
I demonstrate the following concepts:
1) finding the smallest item in an array has O(n) performance.
2) inserting an item into an array has O(n) performance.
3) removing an item from an array has O(n) performance.
4) finding the smallest item in a binary tree has O(1) performance.
5) inserting an item into a binary tree has O(log-n) performance.
6) removing an item from a binary tree has O(log-n) performance.
Visualizing how logarithms worked helped me tremendously in college Calculus. This applied example includes a visualization, using a graph and some self-adhesive sticky notes. If you want to see a practical example of logarithms in real life, this video should help. If you're curious how important math is in computing, this video demonstrates one way it is.
Big-O notation is a study of algorithm performance as the units its operating on grows. Ideally, the algorithm should take no more time, even as the collection it is operating on grows. This is O(1). O(n) indicates that each new item to process equals one additional unit of time. We can slow this growth by using recursion, which gives us a slower growth rate of O(log-n). Slowing growth rate is key for scalability, or fitting more processing on a fixed set of resources.
The binary tree/heap is one technique we can use to slow growth from O(n) to O(log-n). It uses recursion during inserting and removing an item. Seeing the lowest value on a min heap, or the highest value on a max heap, is an O(1) operation, because you simply have to look at the top of the heap. In this video, I show how that works through an example.
1) A real life example of logarithms, applied to computing. This is great for mathematicians who are looking for a true example.
2) Said another way, an example of how math can be used to explain/demonstrate computing concepts.
I demonstrate the following concepts:
1) finding the smallest item in an array has O(n) performance.
2) inserting an item into an array has O(n) performance.
3) removing an item from an array has O(n) performance.
4) finding the smallest item in a binary tree has O(1) performance.
5) inserting an item into a binary tree has O(log-n) performance.
6) removing an item from a binary tree has O(log-n) performance.
Visualizing how logarithms worked helped me tremendously in college Calculus. This applied example includes a visualization, using a graph and some self-adhesive sticky notes. If you want to see a practical example of logarithms in real life, this video should help. If you're curious how important math is in computing, this video demonstrates one way it is.
Big-O notation is a study of algorithm performance as the units its operating on grows. Ideally, the algorithm should take no more time, even as the collection it is operating on grows. This is O(1). O(n) indicates that each new item to process equals one additional unit of time. We can slow this growth by using recursion, which gives us a slower growth rate of O(log-n). Slowing growth rate is key for scalability, or fitting more processing on a fixed set of resources.
The binary tree/heap is one technique we can use to slow growth from O(n) to O(log-n). It uses recursion during inserting and removing an item. Seeing the lowest value on a min heap, or the highest value on a max heap, is an O(1) operation, because you simply have to look at the top of the heap. In this video, I show how that works through an example.
Комментарии