CSL 206 :EXP No: 10 ---- LRU

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024

Комментарии • 33

  • @alfredantu7752
    @alfredantu7752 Год назад +32

    U are only reading out the sentence, not even a single logic

  • @oldmonk4849
    @oldmonk4849 2 года назад +8

    Ith program explain cheyunilalo

  • @minicv7423
    @minicv7423 Год назад +7

    not explained properly

  • @ajmaljalal5430
    @ajmaljalal5430 Год назад +1

    Can you provide the code for Least recently used page replacement algorithm

  • @AKASH-qm6vc
    @AKASH-qm6vc 10 месяцев назад +2

    LFU aarelumm aykuvooo

  • @midhunmuraleedharan363
    @midhunmuraleedharan363 2 года назад +5

    LFU(Least Frequently Used) koode explain cheyyamo

  • @_KRISHNASANGAVIS
    @_KRISHNASANGAVIS 2 года назад +3

    Mam code ayako urgent mam 🥺

  • @harsh6435
    @harsh6435 Год назад +1

    can you share code for optimal page replacement to ?

    • @funnyanimation888
      @funnyanimation888 Год назад +1

      Optimal page replacement algo cant be implemented in the real life as in this algo we need to find the knowledge of the feature and that is not possible

    • @anush8
      @anush8 Год назад

      ​@@funnyanimation888 knowledge of the *future

  • @AnnoyedCave-nt2ib
    @AnnoyedCave-nt2ib 4 месяца назад

    Miss operating system notes alla modules share cheyyamo.

  • @shatvikashadvini1114
    @shatvikashadvini1114 Год назад

    could you send code for optimal algorithm

  • @venow1929
    @venow1929 2 года назад +2

    can you provide the codes of the every programs

    • @swagtech4895
      @swagtech4895 Год назад +13

      #include
      void main()
      {
      int i,j,k,min,rs[25],m[10],count[10],flag[25],n,f,pf=0,next=0;
      printf("Enter the length of the reference string --");
      scanf("%d",&n);
      printf("Enter the reference string -- ");
      for(i=0;i

  • @swagtech4895
    @swagtech4895 Год назад +30

    Code :
    #include
    void main()
    {
    int i,j,k,min,rs[25],m[10],count[10],flag[25],n,f,pf=0,next=0;
    printf("Enter the length of the reference string --");
    scanf("%d",&n);
    printf("Enter the reference string -- ");
    for(i=0;i

    • @soumelee5661
      @soumelee5661 Год назад +4

      thanks :)

    • @swagtech4895
      @swagtech4895 Год назад +1

      @@aparnats2598 ok noted ✅️

    • @lucy2003-d8p
      @lucy2003-d8p Год назад

      @@v3g3ta7then its better for u to drop out the course

    • @j__aa12345
      @j__aa12345 3 месяца назад

      Have Lfu s code like this?

  • @manikyamreddy735
    @manikyamreddy735 2 года назад +2

    Mam next

  • @edgehawkgaming
    @edgehawkgaming 2 года назад

    maam next inte value ntha initialize cheythe?

  • @nithyabalakrishnan3039
    @nithyabalakrishnan3039 3 месяца назад +1

    Very poor explanation

  • @albinjoshy1520
    @albinjoshy1520 2 года назад

    Code link edamo

  • @annmaryjoshy2386
    @annmaryjoshy2386 2 года назад +15

    It is not executing. Waste of time.

    • @swagtech4895
      @swagtech4895 Год назад +2

      It's executing

    • @swagtech4895
      @swagtech4895 Год назад +11

      Run this code the same as in the video
      #include
      void main()
      {
      int i,j,k,min,rs[25],m[10],count[10],flag[25],n,f,pf=0,next=0;
      printf("Enter the length of the reference string --");
      scanf("%d",&n);
      printf("Enter the reference string -- ");
      for(i=0;i

    • @ajmaljalal5430
      @ajmaljalal5430 Год назад

      ​@@swagtech4895do you have code for LFU

    • @afthabmsajid6992
      @afthabmsajid6992 3 месяца назад

      Kitiyo​@@ajmaljalal5430

  • @manthangujar1030
    @manthangujar1030 10 месяцев назад +3

    #include
    void main()
    {
    int i, j, f, pf = 0, rs[25], frame[10], n, age[10];
    printf("
    Enter the length of reference string -- ");
    scanf("%d", &n);
    printf("
    Enter the reference string -- ");
    for (i = 0; i < n; i++)
    {
    scanf("%d", &rs[i]);
    }
    printf("
    Enter no. of frames -- ");
    scanf("%d", &f);
    for (i = 0; i < f; i++)
    {
    frame[i] = -1;
    age[i] = 0;
    }
    printf("
    The Page Replacement Process is --
    ");
    for (i = 0; i < n; i++)
    {
    printf("%d\t", rs[i]);
    int found = 0;
    for (j = 0; j < f; j++)
    {
    if (frame[j] == rs[i])
    {
    age[j] = 0;
    found = 1; // no page fault
    break;
    }
    }
    // Inside the loop where you check for page fault
    if (!found) // page fault
    {
    int flag = 0; // Initialize to -1, indicating no empty frame found
    for (j = 0; j < f; j++)
    {
    if (frame[j] == -1)
    {
    // printf("
    Empty frame");
    frame[j] = rs[i];
    age[j] = 0;
    flag = 1;
    break; // Found an empty frame, exit the loop
    }
    }
    if (flag == 0)
    {
    // If no empty frame is available, perform LRU replacement as before
    int max_age = age[0];
    int max_age_index = 0;
    for (j = 1; j < f; j++)
    {
    if (age[j] > max_age)
    {
    max_age = age[j];
    max_age_index = j;
    }
    }
    frame[max_age_index] = rs[i];
    age[max_age_index] = 0;
    }
    pf++; // Increment page fault count
    }
    // If there was a page fault, print the page fault number
    for (j = 0; j < f; j++)
    {
    printf("\t%d", frame[j]);
    age[j]++;
    }
    if (!found)
    {
    printf("\t\t\tPF No. %d", pf);
    }
    printf("
    ");
    }
    printf("
    The number of Page Faults using LRU are %d", pf);
    }