/// <summary>
        /// Метод добавляет значение в коллекцию. Если хэш-таблица заполнена - вернёт -1.
        /// Если возникает коллизия - метод будет производить рехэширование до тех пор, пока не найдёт место.
        /// </summary>
        /// <param name="word">Значение, которое нужно добавить в коллекцию</param>
        /// <returns>Возвращает индекс, под которым хранится слово помещено слово.</returns>
        public int Add(string word)
        {
            if (this.size == this.values.Length)
            {
                return(-1);
            }

            if (this.IsExists(word))
            {
                return(-1);
            }

            int index = HashFunc.CreateHash(word);

            int lvlOfRehash = 1;

            while (values[index] != null)
            {
                index = ReHashFunc.Rehash(index, lvlOfRehash);
                lvlOfRehash++;
            }

            values[index] = new Cell(word, --lvlOfRehash);

            this.size++;
            return(index);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="word"></param>
        /// <returns></returns>
        public int GetRehashLevel(string word)
        {
            if (!this.IsExists(word))
            {
                return(-1);
            }

            int index = HashFunc.CreateHash(word);

            int lvlOfRehash = 1;

            while (values[index].Value != word)
            {
                index = ReHashFunc.Rehash(index, lvlOfRehash);
                lvlOfRehash++;
            }

            return(values[index].LevelOfHash);
        }
        /// <summary>
        /// Удаляет значение из хэш-таблицы
        /// </summary>
        /// <param name="word">Значение, которое нужно удалить.</param>
        /// <returns>Хэш, по которому хранилось значение.</returns>
        public int Remove(string word)
        {
            if (!this.IsExists(word))
            {
                return(-1);
            }

            int index = HashFunc.CreateHash(word);

            int lvlOfRehash = 1;

            while (values[index].Value != word)
            {
                index = ReHashFunc.Rehash(index, lvlOfRehash);
                lvlOfRehash++;
            }
            values[index] = null;

            this.size--;
            return(index);
        }
        /// <summary>
        /// Метод проверяет, существует ли такой объект уже в хэш-таблице.
        /// </summary>
        /// <param name="word">Слово, наличие которого в хэш-таблице необходимо проверить.</param>
        /// <returns>Существует ли элемент в хэш-таблице.</returns>
        public bool IsExists(string word)
        {
            if (this.IsEmpty())
            {
                return(false);
            }

            int index = HashFunc.CreateHash(word);

            int startIndex  = index;
            int lvlOfRehash = 1;

            while (values[index] != null & (index != startIndex | lvlOfRehash == 1))
            {
                if (values[index].Value == word)
                {
                    return(true);
                }
                index       = ReHashFunc.Rehash(index, lvlOfRehash);
                lvlOfRehash = (lvlOfRehash + 1) % HashFunc.GetMaxValue();
            }

            return(false);
        }