Big O, Math, Logarithms, Heap, Binary Tree, and Computing Explained with Simple Live Example

preview_player
Показать описание
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.
Рекомендации по теме
Комментарии
Автор

Wow that was an incredible demo, thank you for sharing! This is by far the clearest explanation of why heaps are faster that I've seen.

patriciadegner
Автор

Thanks Brandan for making these videos, I study CS and finding this extremely helpful!

projectcodemastery
Автор

The time you learn it out of interest as an adult instead of just studying to pass the exams is when you really get it

shekhar_sahu
Автор

Great visual explanation of a challenging topic. Nicely done!

bbowling
Автор

Finally. From my favorite explainer on any topic. Thank you prof!

bboywaters
Автор

amazing explanation. What was the book of Data Structures you read?
Keep on the good work

everiguado
Автор

Hey Brandan, your videos are extremely helpful. I am in my mid 20s, unemployed, hoping to be an android developer. I have always had a hard time grasping the concepts of programming when taught in college. I could always memorize what I was taught but connecting the dots to actually learn the concept was always challenging.
I would love to be taught by you, you are already teaching me but more like an online class would be much more helpful. Are you taking on any android classes during this lockdown? I would be delighted to take your classes

norulesprateek