<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3AApril_3</id>
	<title>SE250:April 3 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3AApril_3"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:April_3&amp;action=history"/>
	<updated>2026-04-28T18:43:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=SE250:April_3&amp;diff=1761&amp;oldid=prev</id>
		<title>Mark: 3 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:April_3&amp;diff=1761&amp;oldid=prev"/>
		<updated>2008-11-03T05:08:39Z</updated>

		<summary type="html">&lt;p&gt;3 revision(s)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Minutes ==&lt;br /&gt;
Minute Taker: [[User:Jpar277 | jpar277]]&lt;br /&gt;
&lt;br /&gt;
Wrapped up the rest of the Linked Lists.&lt;br /&gt;
Copy, Append are the hardest code for Linked Lists, we&amp;#039;re expected to understand them but not expected to produce them under exam conditions.&lt;br /&gt;
We should have a good grasp of going through a Linked List 1 by 1 and knowing when to refer to the head and when to refer to the tail.&lt;br /&gt;
We should also be able to draw a Linked List diagram and relate it to code.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Hashing ::::&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Hash Tables are basically an Array with Linked Lists as the elements in the Array.&lt;br /&gt;
&lt;br /&gt;
Hashing is a technique that allows very fast access to a collection of objects indexed by a key (e.g. student ID, UPI) that is used as a unique index.&lt;br /&gt;
No two values have the same key.&lt;br /&gt;
&lt;br /&gt;
An Array is &amp;quot;almost&amp;quot; this structure, where the key is a small integer.&lt;br /&gt;
&lt;br /&gt;
object array [ ]&lt;br /&gt;
array [ key ] -- this is a mapping from key to object.&lt;br /&gt;
&lt;br /&gt;
Having a small integer as the key is not always convinient.&lt;br /&gt;
&lt;br /&gt;
Hashing &amp;quot;magically&amp;quot; removes the small integer restriction, at almost no additional cost.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Code Example ::::&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 typedef char* key_t;&lt;br /&gt;
 typedef double value_t;&lt;br /&gt;
 &lt;br /&gt;
 typedef struct Cell {&lt;br /&gt;
 	key_t elt;&lt;br /&gt;
 	value_t value;&lt;br /&gt;
 	struct Cell* next;&lt;br /&gt;
 } Cell;&lt;br /&gt;
 &lt;br /&gt;
 typedef struct {&lt;br /&gt;
 	int size;&lt;br /&gt;
 	Cell* table;&lt;br /&gt;
 } HashTable;&lt;br /&gt;
 &lt;br /&gt;
 void add (HashTable* ht, key_t key, value_t value) {&lt;br /&gt;
 	//      ^^^ we want the reference and not the whole thing - hence the star&lt;br /&gt;
 	int i = hash(key);&lt;br /&gt;
 	// resize the table if necessary&lt;br /&gt;
 	ht-&amp;gt;table[i % ht-&amp;gt;size] = cons(key, value, ht-&amp;gt;table[i % ht-&amp;gt;size]);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 value_t loopup (HashTable* ht, key_t key) {&lt;br /&gt;
 	int i = hash(key);&lt;br /&gt;
 &lt;br /&gt;
 	for(cp = ht-&amp;gt; table[i % ht-&amp;gt;size]; cp != nil; cp = cp-&amp;gt;next)&lt;br /&gt;
 		if (cp-&amp;gt;key == key)&lt;br /&gt;
 			return cp-&amp;gt;value;&lt;br /&gt;
 &lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Hash is a function that we must define and it must be fast.&lt;br /&gt;
&lt;br /&gt;
Cheaper to compare 2 ints than 2 strings.&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>