diff options
Diffstat (limited to 'comp/work/52/hashing.ms')
-rw-r--r-- | comp/work/52/hashing.ms | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/comp/work/52/hashing.ms b/comp/work/52/hashing.ms new file mode 100644 index 0000000..89d6b45 --- /dev/null +++ b/comp/work/52/hashing.ms @@ -0,0 +1,54 @@ +.TL +Hashing +.AU +Lucas Standen +.AI +QMC + +.2C + +.EQ +delim @@ +.EN +.EQ +delim @# +.EN + +.NH 1 +Starter (FDE Cycle) +.LP +1) The program counter, Memory address register, Memory data register, Current instruction register, Status register + +2) Control bus, Data bus, Address bus + +3) Arithmetic logic unit + +4) Control unit + +.NH 1 +Hashing +.LP +This is the process of converting data to a internal representation of some data. We can use this to do many things, for example, when using a password, storing the hash can be better for security, as it is keeps the actual password safe while allowing for password checking. + +A hash table is a store of many hashes in a dictionary style data structure. The requirements for a has table are as follows +.EQ +"you should have about a third more spaces avalible than needed" +.EN +This is to avoid crashes/collusions. +.EQ +"you need to automatically resize the dictionary whenever is needed" +.EN +This is to avoid running out of space to store values. +.NH 2 +Hash table collusions +.LP +This is what happens when you have 2 bits of data that produce the same hash, and thus would go in the same slot in the dictionary. To fix this you can store a list in each slot of the dictionary, and put the new element on the end of the list of elements with the same hash. You could also achieve this by putting the data in the next available hash table slot. + +.NH 1 +Exam question on hashing +.LP +1)a)i) This can be faster to retrieve data, as all you need to know is its name, and you can quickly find the hash, and then the full value. + +1)a)ii) This can be easier to manage, as you don't need to worry about hash collusions. + +1)b) 751, 751 |