Microsoft interview question

how to find if two rectangles intersect

Interview Answer

Anonymous

7 Nov 2012

without using a data structure or a class for the rectangle //A(x1, y1) - coordinates for the top left edge //A(x2, y2) - coordinates for the bottom right edge bool isIntersecting(int aX1, int aX2, int aY1, int aY2, int bX1, int bX2, int bY1, int bY2) { return aX1 bX1 && aY1 bY1; }