私は挿入機能を追加しました。表示は誰でも助けてくれるでしょう 私は削除をお願いします。あなたのコードとあなたの説明から、Java削除機能
public class Node
{
Object data;
Node next;
}
public class LkList {
public Node insertVar(Object var1, Node ls1) {
Node p = new Node();
p.data = var1;
p.next = ls1;
ls1 = p;
return ls1;
}
public Node deleteVar(Object var1, Node ls1){
// deletion function goes here
}
public void printL(Node ls1) {
System.out.print("The lklist of variables is: ");
Node p = ls1;
while (p != null) {
System.out.print("[" + p.data + "]" + "->");
p = p.next;
}
System.out.println();
}
}
なぜあなたはhttps://stackoverflow.com/questions/47385901/java-deletion-functionや投稿を削除でしたを使用してノードを比較しないでください。再び? – Eran
**何から?** – EJP
@Eran削除されたので、私は推測しています。 –