Paging Algorithms in C/C++