Hash Dictionary Object Oriented Programming C#

Job ID: 36226658

Budget: $30 – $250 USD

### Hash dictionary

C# has a generic [Dictionary<K,V>](https://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.110).aspx) collection class that implements the [IDictionary<K,V>](https://msdn.microsoft.com/en-us/library/s4ys34ea(v=vs.110).aspx) interface. According to MSDN: "The Dictionary class provides a mapping from a set of keys to a set of values. Each addition to the dictionary consists of a value and its associated key". The focus of this assignment is the use of generics, and the understanding of interfaces and interface inheritance by implementing and using your own class(es).

This assignment consists of two parts:

### Part 1 - creating `HashDictionary<K,V>`

In this part you will create your own class that implements the [IDictionary<K,V>](https://msdn.microsoft.com/en-us/library/s4ys34ea(v=vs.110).aspx) interface. In order to implement the [IDictionary<K,V>](https://msdn.microsoft.com/en-us/library/s4ys34ea(v=vs.110).aspx) interface you must understand and implement the [ICollection<T>](https://msdn.microsoft.com/en-us/library/92t2ye13(v=vs.110).aspx) interface, and the [IEnumerable<T>](https://msdn.microsoft.com/en-us/library/9eekhta0(v=vs.110).aspx) interface. Implement the hashtable using some form of dynamic array or list and perform a linear search when looking for values

### Part 2 - creating classes for keys
In this part you will a class GeoLocation that represents a location on earth using latitudes and longitudes. Make all the necessary functions and operator overloads to make it possible to use this class as a key for the `HashDictionary<K,V>` class. In particular, ensure that hashing and equality is done using the latitude and longitude and not object identity.

### Steps
To complete this assignment follow the steps below.
1. Study the interfaces you have to implement, [IDictionary<K,V>](https://msdn.microsoft.com/en-us/library/s4ys34ea(v=vs.110).aspx) , KeyValuePair<K,V>, [ICollection<T>](https://msdn.microsoft.com/en-us/library/92t2ye13(v=vs.110).aspx), [IEnumerable<T>](https://msdn.microsoft.com/en-us/library/9eekhta0(v=vs.110).aspx), and [IEnumerator<T>](https://msdn.microsoft.com/en-us/library/78dfe2yb(v=vs.110).aspx).
2. Design your solution and discuss your solution with the assistants. The design is relatively straight forward this time, since it, to a large extent, is controlled by the demands of the interfaces.
3. Implement the assignment based on the design. Revise the design if needed - iteration may be necessary.
4. Make sure your solution passes `HashtableTester.TestDriver.Instance.Run(d, 10000);` as this is what we do. We won't grade solutions that do not pass 10000 tests.

### Hints

- While [IEnumerator<T>](https://msdn.microsoft.com/en-us/library/78dfe2yb(v=vs.110).aspx) demands [IDisposable](https://msdn.microsoft.com/en-us/library/system.idisposable(v=vs.110).aspx) it is ok to leave the `Dispose` method empty - we have not talked about disposing objects. If you are interested you can read about Destructors in the programming guide.
- The [Object](https://msdn.microsoft.com/en-us/library/system.object(v=vs.110).aspx) class provides a [GetHashCode](https://msdn.microsoft.com/en-us/library/system.object.gethashcode(v=vs.110).aspx) method.
- You will need to use the [KeyValuePair<K,V>](https://msdn.microsoft.com/en-us/library/5tbh8a42(v=vs.110).aspx) structure to be compatible with the [IDictionary<K,V>](https://msdn.microsoft.com/en-us/library/s4ys34ea(v=vs.110).aspx) interface.