因此,我正在完成我的程序,其中測(cè)試通過測(cè)試程序中的單詞列表,并使用前綴,我清除了它,只返回匹配的單詞。以下是我的以下代碼包含的方法和測(cè)試方法的片段,我只是想知道我做錯(cuò)了什么?包含方法public boolean containsKey(TrieMapNode current, String curKey) { // recursively get the value for the current node String value = get(current,curKey); // if value if null or empty, key is not found return false if(value == null) { return false; }else if (value.equals("")) { return false; } else { return true; }}現(xiàn)在,我在運(yùn)行測(cè)試時(shí)得到的輸出是正確的包含單詞,但是盡管有包含方法,但錯(cuò)誤數(shù)仍然是0,所以我不確定我做錯(cuò)了什么。任何幫助將不勝感激
包含方法和計(jì)數(shù)器更新
拉風(fēng)的咖菲貓
2022-09-22 19:20:56