Here is the code implementation of the above title:- https://ide.codingblocks.com/s/445888, the few things where I am having doubts are:-
- First of all, I made arr of int data type and I am putting chars of string in it, and it is not producing any error, does it mean it is internal type casting?
- When I am putting numeric chars of string in arr as (str[i]-‘0’ ) because arr is of int type, so no of page faults becomes 10 and if not then answer of page faults is coming out to be 9, how is it so?
- Is there any mistake in implementation of this algorithm because not getting expected answer.
Please comment out the mistakes if any in code so as to make it to know what is exactly the mistake.