MS Jeong - Blog
[Function] binarySearch: find x in v[0] <= v[1] <= ... <= v[n - 1]
/* binarySearch: find x in v[0]
Programming/Function
2017. 8. 8. 23:59
[Function] rightRot(unsigned x, unsigned n): rotate x to right by n bit positions
/* rightRot: rotate x to right by n bit positions */ unsigned rightRot(unsigned x, unsigned n) { unsigned int temp, len, mostRight; for (temp = x, len = 1; (temp >>= 1); len++) { ; } mostRight = (1 > 1) | mostRight); } else { x >>= 1; } } return x; }
Programming/Function
2017. 8. 8. 23:51