Ejemplo n.º 1
0
        public void Add(string item)
        {
            LinkedString me            = new LinkedString(item, null);
            int          hashKey       = (int)((uint)item.GetHashCode() % capacity);
            LinkedString currentAtHash = values[hashKey];

            if (currentAtHash != null)
            {
                if (currentAtHash.nextValue != null)
                {
                    currentAtHash = currentAtHash.nextValue;
                }

                currentAtHash.nextValue = me;
            }
            else
            {
                values[hashKey] = me;
            }
        }
Ejemplo n.º 2
0
 public LinkedString(string myValue, LinkedString nextValue)
 {
     this.myValue   = myValue;
     this.nextValue = nextValue;
 }