我需要一個C#程序(搜索算法),即,當用戶鍵入字符,顯示屏應更新,以顯示下一個字符,可能匹配的電臺列表中的所有有效的選擇。搜索算法所需
例:用戶輸入:d A R T,它應該顯示
DARTFORD和DARTMOUTH
建議概要低於:
public class Suggestions
{
HashSet<Character> nextLetters { get; set; }
HashSet<String> stations { get; set; }
}
public class StationFinder
{
private static String[] stations = new String[] {"LIVERPOOL LIME STREET", "BIRMINGHAM
NEW STREET", "KINGSTON", " DARTFORD", "DARTMOUTH" };
public Suggestions GetSuggestions(String userInput)
{
// TODO Compute result
Suggestions result = new Suggestions();
return result;
}
}
這僅僅是一個建議它也可被修改。
問候,毗溼奴
[你嘗試過什麼(http://whathaveyoutried.com)? – Amadan
老兄你甚至沒有標記,以供.net和這氣味像功課 – Paparazzi