我一直在嘗試在Java中實現迭代深化搜索。但是,出於某種原因,並非所有的孩子,對於每個節點都正在訪問,導致不正確的結果。這是我到目前爲止的代碼: public int IDS(Node start, Node goal){
int depth = 0; //set starting depth to 0
Node current=start; //current node
我想創建一個擴展LinkedList類的SortedList類,兩者之間的唯一區別是SortedList有一個方法來插入無論它保持順序。我使用的compareTo有 public class SortedList<T> extends LinkedList<T> implements Iterable<T> {
// Class variables and constructor