Is there a reason you have used a SingleLinkedList?
I personally would have gone for something more strongly typed:
//private collection that you can add/update/remove
private List<DictionaryEntry> _dictionary;
//class to store each entry with public properties to access values
public class DictionaryEntry
{
private string _word;
private string _description;
public DictionaryEntry()
{
_word = string.Empty;
_desc = string.Empty;
}
public string Word
{
get { return _word; }
set { _word = value; }
}
public string Description
{
get { return _description; }
set { _description = value; }
}
}
Linked Lists are usually used to store data where the order is important such as stacks/queues/etc.
I dont see a reason to maintain links between your dictionary items so a List is a better way to go :)
Ryshad
Nearly a Posting Virtuoso
1,307 posts since Aug 2009
Reputation Points: 512
Solved Threads: 246