Ad
  • Custom User Avatar

    Because at that point of the algorithm 2 is the page that has been sitting inside the memory the longer, so that is the one to replace (so basically is at the front of the queue) and its position inside the memory is occupied by the new page

  • Custom User Avatar

    You are supposed to generate the values of the Fibonacci sequence up to n terms (here n=5 is the input).

    This means - starting at 1 - [1,1,2,3,5].

    If you are having problems with this, you should read any resource on the Fibonacci sequence - for example:

    Fibonacci number on wikipedia

    Then you must consider the elements you obtained, and replace those that are divisible by 3 or by 5 according to the other rules mentioned in the description.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution