<div dir="ltr">Hi, hash fans<div><br></div><div>A couple of approachable explanations of hash functions, associative arrays and collisions can be found on Youtube. They would be good for your class' potential future hash users.</div><div><br></div><div><div><a href="https://www.youtube.com/watch?v=MfhjkfocRR0">https://www.youtube.com/watch?v=MfhjkfocRR0</a></div><div><a href="https://www.youtube.com/watch?v=h2d9b_nEzoA">https://www.youtube.com/watch?v=h2d9b_nEzoA</a></div><div><br></div><div>There are several others, BTW. Have a look around.</div><div><br></div><div><b>Linked lists</b> are not KK, but are often essential in solving collisions, and are good basic nutritious IT theory if you find the time.</div><div><br></div><div>Also, <b>sparse arrays</b> may become relevant as hash functions create huge hash values, requiring huge arrays that can accommodate huge hashed indexes. Sparse arrays are not key knowledge, but your stronger students might find them an interesting problem.</div><div><br></div><div>An interesting exercise is to get your kids to brainstorm hashing algorithms and choose the best one based on its speed, the number of collisions it will create, and the size of the necessary array will have to be. (Other criteria may also apply, e.g. whether similar values generate similar hash codes.)</div><div><br></div><div>Some very basic starting points for algorithms:</div><div>- the length of the string (very easy to compute, many many collisions)</div><div>- the sum of the ASCII codes of each letter of the string. (but letter positioning loses value, so "cat" and "act" will generate the same hash value)</div><div>- as above, but each letter's ASCII code is multiplied by the letter's position in the string. This introduces information based on the position of text, not just its presence, so "cat" and "act" generate different hash codes. - hard to compute, very few collisions, huge array needed.</div><div><br></div><div>- others?</div><div><br></div><div><br></div><div>Regards,</div><div>Mark</div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><i><br></i></div><div><span style="font-size:12.8px">Mark Kelly</span><br></div><div><br></div><div><a href="mailto:mark@vceit.com" style="font-size:12.8px" target="_blank">mark@vceit.com</a><br></div><div><a href="http://vceit.com" target="_blank">http://vceit.com</a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div>