41.
Consider the given page reference string 0, 1, 3, 7, 1, 7, 0, 3, 6, 8. How many page faults will occur if the program has 4-page frames available to it and it uses the random page replacement algorithm?

43.
Which of the following should be the base case for the recursive solution of a set partition problem?

If(sum%2!=0)
   return false;
if(sum==0)
   return true;

If(sum%2!=0)
   return false;
if(sum==0)
   return true;
if (n ==0 && sum!= 0) 
   return false; 

if (n ==0 && sum!= 0) 
    return false; 

if(sum<0)
   return true;
if (n ==0 && sum!= 0) 
   return false; 

47.
What is the time complexity of the following code used to find the length of a linked list?
#include<stdio.h>
#include<stdlib.h>
struct Node
{
      int val;
      struct Node *next;
}*head;
int recursive_get_len(struct Node *current_node)
{
      if(current_node == 0)
        return 0;
      return 1 + recursive_get_len(current_node->next);
}
int main()
{
      int arr[10] = {-1,2,3,-3,4,5,0}, n = 7, i;
      struct Node *temp, *newNode;
      head = (struct Node*)malloc(sizeof(struct Node));
      head->next = 0;
      temp = head;
      for(i=0; i<n; i++)
      {
          newNode = (struct Node*)malloc(sizeof(struct Node));
          newNode->val = arr[i];
          newNode->next = 0;
          temp->next = newNode;
          temp = temp->next;
      }
      int len = recursive_get_len(head->next);
      printf("%d",len);
      return 0;
}

50.
Which of the following statement about 0/1 knapsack and fractional knapsack problem is correct?