0
C# linkedlist enumerator chaining.Class linkedListEnumerator : IEnumerator
Im making HashTable with a dictionary class that Implements IDictionary, Im using a linked list of KeyValuePairs where I have to create an enumerator class to enumerate the hashtable, but I dont know how to implement my enumerator class. It is so far named LinkedListEnumerator : Ienumerator<KeyValuePair<TKey, TValue>> but Im not sure how to do the constructor nor the movenext method or what fields I need Im creating and implementing the new Im trying to use chaining, so the first linked list is not dynamic but the ones holding the keyValuePairs are dictionary class, so not just using the Dictionary hashTable = new Dictionary I dont understand what type current should be in the enumerator class and what the constructor should take in
1 Odpowiedź
0
I'm gonna be one of those guys but just use the List class with bult in enumerator. If you have to rebuild it from scratch, just look at how List is built.