Friday, 8 April 2016

week 12 -- def hash

This week, the last before exams officially begin, we discussed hashing. This is a method which converts lists or other data types so that we may access items in that structure with quick and efficient time, doing so by storing the information of the object in a list-like structure.

Some of the major nuances which must be dealt with when hashing are the encounters of possible collisions, that is when two keys of items end up pointing to the same position. One way to resolve this is through probing, which is exploring until a new index is available - i.e., not occupied by another item.

We know that a great advantage of hashing - present in Python dictionaries, has very fast running time, O(1). The faster time comes at the expense of putting in extra work to order the keys of the dictionary.

Currently, I'm not very comfortable with hashing, so I will have to run through the examples once more as well as implementing some of the practice code that we have visited in class.

No comments:

Post a Comment