Could anyone please explain each branch, how each element would be arranged in each case?Code:private static final Comparator<Node> comparator = new Comparator<Node>() { public int compare(Node one, Node two) { if (one.id == two.id) return 0; if (one.f < two.f) return -1; if (one.f > two.f) return 1; return (one.id < two.id) ? -1 : 1; } };
For example, when one.id == two.id, it returns 0; will "one" be put after or before "two"?
Thanks
Jack




Reply With Quote