|
|
@ -69,16 +69,13 @@ public class SparseVector { |
|
|
|
Node now = this.head; |
|
|
|
|
|
|
|
while (now != null && now.index < index) { |
|
|
|
|
|
|
|
if (now != null && now.index == index) { |
|
|
|
return now.value; |
|
|
|
} |
|
|
|
now = now.next; |
|
|
|
} |
|
|
|
|
|
|
|
if (now != null && now.index == index) { |
|
|
|
|
|
|
|
double result = now.value; |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
return 0.0; |
|
|
|
} |
|
|
|
|
|
|
|