for division, a adding function needs to be built first int add(int x, int y) { int a, b; do { a = x & y; b = x ^ y; x = a << 1; y = b; } while (a); return b; } the following part would be easy. For the median searching problem, do not seek to load all the data into memory once for all. Do it in a smarter way. And keep in mind, the total number of integers are finite, so ask how much memory you can use, and do it with possibly multiple passes.

For integer division by 2 of unsigned int, use the shift operator. For other type of divisions, need to think more :)