|
|
@ -118,6 +118,12 @@ public class SparseVector { |
|
|
|
//Terry: bool Methode equals: testen, ob other = this (nur vergleichen die Nicht-Null Elemente) |
|
|
|
public boolean equals(SparseVector other) { |
|
|
|
|
|
|
|
if(this.getLength() != other.getLength()){ |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Node thisnow = this.head; |
|
|
|
Node othernow = other.head; |
|
|
|
|
|
|
@ -146,6 +152,7 @@ public class SparseVector { |
|
|
|
// Terry: void add: to add two vectors together and renew (overwrite) the this.vector |
|
|
|
public void add(SparseVector other) { |
|
|
|
|
|
|
|
|
|
|
|
Node thisnow = this.head; |
|
|
|
Node othernow = other.head; |
|
|
|
Node thispre = null; |
|
|
|