Ejemplo n.º 1
0
        private int FindInsertPosisition(string str)
        {
            int posisition = SearchInsertPosition(str);

            while (BoundarySuffix.Contains(Array[posisition]))
            {
                posisition++;
            }

            return(posisition);
        }
Ejemplo n.º 2
0
        private void InsertSuffixes(string str, int index, int currentLength)
        {
            for (int i = str.Length; i >= 1; i--)
            {
                int z            = Array.GetInverse(index - i + str.Length);
                int suffixLength = currentLength - i + str.Length;

                int pos = BinarySearch.BinarySearch.Instance.BinarySearchFirst(0, z, new BlockSuffixArrayInsertStringFirstStrategy(this, z, i, str[str.Length - 1]));

                Array.Insert(pos, suffixLength);
                Lcp.Insert(pos, i);
                BoundarySuffix.Add(suffixLength);
            }
        }