LRU algorithm implementation
I don't know the LRU Algorithm. So I can't criticize the implementation. The most glaring problems are:


Undescriptive variable names, like "tmr", "n" and "m".
Undescriptive procedures, like "max" (max of what? The return value is not the maximum value of the array, but the position).
The use of "magic" numbers. Like the number 20 for example. Store that number in a descriptive constant.
The logic of the main procedure.


For example

 else
 {
     if(...)


could be written as such

else if(...)