Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8871581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:01:22+00:00 2026-06-14T18:01:22+00:00

Okay, i am trying to understand OPT algorithm then it will make it easy

  • 0

Okay, i am trying to understand OPT algorithm then it will make it easy for me to code it.
I cant follow along with the slide and its making no sense. Can someone walk me through it step by step on how to do it?

This looks identical to the LRU algorithm. Do we keep a second array with a counter?

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:01:23+00:00Added an answer on June 14, 2026 at 6:01 pm

    You apparently must know in advance which pages are going to be used and in what order; this is the list 1, 2, 3, ..., 4, 5 in your example. When you must replace a page, you choose the frame containing the page that will be used last amongst all of them.

    In this example, you access pages 1, 2, 3, 4, 1, and 2 without any page faults (since all pages are currently swapped in).

    Your next page access, page 5, is not in any frame, so you must choose a frame to put it into. Based on upcoming page hits (1, 2, 3, 4), page 4 (in frame 4) will be last to be accessed, so you swap page 5 into frame 4 (as shown in your diagram).

    The next pages, 1, 2, and 3 are accessed without any fault.

    Now page 4 is accessed but it was previously swapped out so you have a page fault. Your list of upcoming accesses shows only page 5 will be needed, so any of 1, 2, and 3 may be swapped out. 1 was chosen, presumably because it is first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay so I'm trying to make a little gag program that will run away
okay i have been trying to understand this for hours i am learning VB
I'm trying to understand the power of functors. Okay, so they are pointers to
I've got part of code from friend and I'm trying to understand it and
As I'm trying to understand SQL by playing around with the code a bit,
Okay I'm basically day 1 at programming trying to follow Ruby On Rails 3
Okay i'm trying to understand WPF and the popular MVVM Pattern. Now i have
Okay I'm trying to go for a more pythonic method of doing things. How
Okay I been trying to work this out but unable too. I have a
Okay so I've been trying to position these 4 divs for about 6 hours

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.