Microsoft Interview Question
Software Engineer / Developersif you are measuring width along x axis dont you think it should be
getScreenWidth() * x + y e.g. (1,2) would be stored in the 73rd position if width is 70 (lets say). Correct me if i am wrong or reading it incorrectly.)
you guys sure abt the expression you have used for pixelPos?
IMO, it should be something like this:
pixelPos=no_of_cols*(x-1)+y
{
- Anonymous January 03, 2010int pixelPos = getScreenWidth() * y + x;
pixelArray[pixelPos] = true;
}