Week 12: Final preparation, hashing, farewell (maybe…)
So…..the time has come! It’s almost time to test all my knowledge I gained in this course in the final exam! This last week we have learned about hash tables and Big O. FINALLY we are incorporating the material we have been learning in CSC165 and everything suddenly makes sense to me (Big O, running time complexity). It’s been a little hard to focus on the hashing material this week with all the distractions from finals and last assignments. From my understanding, a hash function is a function that takes input of a variable length sequence of references to objects and converts it to a fixed length sequence. It is a one way function. This means if f is the hashing function, calculating f(x) is pretty fast and simple, but trying to obtain x again will take years. The value returned by a hash function is often called a hash value. Most of the time a hash function will produce unique output for a given input. However depending on the algorithm, there is a possibility to find a collision due to the mathematical theory behind these functions.
Once you have hashed an object to a number, you can easily use part of that number as an index to a list to store the object or something related to it. If the list is of length n, you might store information about the object A at index hash(A) % 0.
Dictionaries are implemented using hash tables! These tables are sort of difficult to understand (for me) but maybe staring at the example codes for a bit will help me, then I can implement some of the class examples again such as the birthday paradox one.
I am also planning my review for the final exam! I am going all out with studying this time… I have made enough mistakes with past midterms and quizzes that I should be able to overcome now! I’m definitely going to go to the last few office hours for help and do a study group! Of course, I will do a lot of practice with past labs and assignments as well.
Now… this will probably be my last post. But, I’ve had fun updating you on my progress and (mainly) struggles in this course! I hope I haven’t bored anyone to death. Whoever has read my posts, thank you for taking the time to do so! :)










