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 7636839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:47:10+00:00 2026-05-31T07:47:10+00:00

I need some help on figuring out a way to store my data that

  • 0

I need some help on figuring out a way to store my data that is efficient. I am writing a scheduling algorithm using priority queues which include not-yet-submitted, ready, running, blocked, and completed. All processes begin in the not-yet-submitted state. My information comes from the standard input.

Each line below explained (respectively):

first line = CPUs in the system (1 to 4), the number of processes (1 to 25), and the quantum size (1 or larger).
second/third = the process ID (1 to 999), the process priority (1 to 10),
the time of submission (non-negative),the total CPU time required (1 to 1000),
the compute time before input/output is needed (1 to 100),
and the input/output time for each compute-I/O cycle (1 to 1000).

Sample Input
1 2 10
1 1 0 10 5 10
2 2 3 10 5 10

The second and third lines are separated processes and there can be up to 25 processes. initially I was thinking just store each process into its own array so I could move that array from Queue to Queue with ease but creating 25 different arrays and then possibly not using them is very inefficient. Is there a more simple way store my “processes” so I can move them between the states (which is represented by the queues)?

  • 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-05-31T07:47:11+00:00Added an answer on May 31, 2026 at 7:47 am

    I would make a Process class that contains the state expressed on the second/third lines above. Something like:

    class Process {
        private int pid;
        private int priority;
        private int submissionTime;
        private int totalCpuTime;
    }
    

    And store instances of the class in a queue. No reason not to make a queue for the waiting processes. Then move the instances to other queues as needed.

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

Sidebar

Related Questions

I need some help figuring out the best way to proceed with creating a
Need some help assigning a mouseover event to display some icons that start out
I have a 5 byte data element and I need some help in figuring
Hey all, i am in need of some help with figuring out how to
I need some help figuring out how to do something. I got this gallery
I need some help figuring out a query I have 3 tables sources id,
I'm a n00b and I need some help figuring out this issue, I would
I'm looking to implement the Shunting-yard Algorithm , but I need some help figuring
I need some help figuring out what I'm doing wrong here. I am trying
I need some help figuring out a solution to a z-index problem with ie7.

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.