mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-19 17:54:42 +08:00
Fixed Error:(6, 8) java: class algorithm is public, should be declared in a file named algorithm.java. Inside file PrimeFactorization, the name of public class was wrong.
This commit is contained in:
@ -117,7 +117,21 @@ public class HeapElement {
|
||||
* @return true if the keys on both elements are identical and the additional info objects
|
||||
* are identical.
|
||||
*/
|
||||
public boolean equals(HeapElement otherHeapElement) {
|
||||
return (this.key == otherHeapElement.key) && (this.additionalInfo.equals(otherHeapElement.additionalInfo));
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o != null) {
|
||||
if (!(o instanceof HeapElement)) return false;
|
||||
HeapElement otherHeapElement = (HeapElement) o;
|
||||
return (this.key == otherHeapElement.key) && (this.additionalInfo.equals(otherHeapElement.additionalInfo));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = 0;
|
||||
result = 31*result + (int) key;
|
||||
result = 31*result + (additionalInfo != null ? additionalInfo.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user