Browse Source

terry: kleine Anderung in equals erste if Bedingung

master
Terry Kwan 1 year ago
parent
commit
0bff28f3b0
  1. 7
      SparseVector.java

7
SparseVector.java

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

Loading…
Cancel
Save