After learning a couple of different sorts available in Python, at first I was wondering why we are learning this as it is obvious that we can choose any of them and they will work perfectly! However, then came the reason, even though to us currently, 1 second is not a big difference when running our code, when you have a lot of different aspect each taking that 1 second and all other functions rely on them, it builds up considerably.
Dr. Heap then showed is different sorts and how they are labeled with Big O Notation and it finally made sense when people online are referring to their codes using O(n) or something like that. Now I understand the importance of logically solving the problems but ensuring that their running time are kept to the minimum when the size increases. Like the Lab when comparing Queues and Stacks.
No comments:
Post a Comment