haveOverlap differs from canMerge in that it tells you if the intersection of a and b would contain an element (otherwise it would be the empty set, and we return false).
(a, b interval16)
| 311 | // it would be the empty set, and we return |
| 312 | // false). |
| 313 | func haveOverlap16(a, b interval16) bool { |
| 314 | if int(a.last())+1 <= int(b.start) { |
| 315 | return false |
| 316 | } |
| 317 | return int(b.last())+1 > int(a.start) |
| 318 | } |
| 319 | |
| 320 | // mergeInterval16s joins a and b into a |
| 321 | // new interval, and panics if it cannot. |
searching dependent graphs…