Relative Content

Tag Archive for javaarrayssegment

Not intersected segments on java

Help me please, It’s my university task and I don’t know how to solve it, because I need fast solution.
Given two arrays a and b of length N consisting of integers. Consider a set of segments connecting points (0,ai) and (1,bi) for
1≤i≤N. Find the number of segments in this set that do not intersect with other segments.