Tuesday, January 7, 2014

A brief review of programming interviews exposed book.
Bitwise operations - OR(any), AND(both) and XOR(same=0,different=1)
Shift operations - Base 2 right shift => divide by 2 and left shift => multiply by 1
Rectangle overlap is written as a.ul.x <= b.lr.x && a.ul.y >= b.lr.y && a.lr.x >= b.ul.x && a.lr.y <= b.ul.y
union{
int theInteger
char singleByte;
} endianTest;
endianTest.theInteger = 1
return endianTest.singleByte;
Permutations proceeds with an array of booleans for each element that denotes whether it is used
Combinations proceeds with varying start
Tackle graphical and spatial problems with pictures and over time.
Tackle Nodes and lists with previous, current and next variables during traversal.
Trees and Graphs are best tackled with traversals.

No comments:

Post a Comment