CInterval inter[num];...for (int i = 0; i < num - 1; ++i) { for (int j = i + 1; j < num; ++j) { if (Intersect(inter[i], inter[j])) DoProcess(inter[i], inter[j]); }}
C++ (Qt)(mas[x].left <= current.right) && (mas[x + 1].left > current.right)
struct CInterval { float mBeg, mEnd;};struct CPoint { float Get( void ) const { return mBegin ? mInter->mBeg : mInter->mEnd; } // data CInterval * mInter; bool mBegin;};
struct CIntervalLookup { CIntervalLookup( CInterval * intr, size_t count ); // can be also a vector, list etc ~CIntervalLookup( void ); // destroys internal points and lists bool NextInters( size_t theIndex[2] ); // returns false if no more overlapped intervals // otherwise fills theIndex with 2 indices ....};