Example #1
0
        /// <summary>
        /// Get Node's value by Index
        /// </summary>
        /// <param name="Index">Index start from 1.</param>
        /// <returns>if Index is valid ,return real value otherwise ,return -1</returns>
        public int GetValue(int Index)
        {
            List <int> listSet = RBTree.ToList <int>();

            if (Index <= listSet.Count)
            {
                return(listSet[Index - 1]);
            }
            return(-1);
        }
 public System.Collections.Generic.List <string> Permutation(string str)
 {
     System.Collections.Generic.SortedSet <string> lst = new System.Collections.Generic.SortedSet <string>();
     if (str.Length == 0)
     {
         return(lst.ToList());
     }
     if (str.Length == 1)
     {
         lst.Add(str);
         return(lst.ToList());
     }
     System.Collections.Generic.List <int> pivotes = new System.Collections.Generic.List <int>();
     for (var i = 0; i < str.Length; ++i)
     {
         Permutation(str, i, "", pivotes, lst);
     }
     return(lst.ToList());
 }