The Gateway to Computer Science Excellence
+2 votes

A CPU scheduling algorithm determines an order for the execution of its scheduled processes. Given 'n' processes to be scheduled on one processor, how many possible different schedules are there?

  1. $n$
  2. $n^{2}$
  3. $n!$
  4. $2^{n}$
in Combinatory by Boss (30.8k points)
retagged by | 2.5k views

2 Answers

+11 votes
Best answer
preemptive= infinite way

non preemptive=n!

by Boss (11.1k points)
selected by
In all case n! Only
no , only for nonpreemptive it will be n!

because, it takes 1 process at a time and completes it

So, 1st process can executes n ways

2nd process can execute (n-1) ways

3rd process can executes (n-2) ways......

So, n process can executes n! ways
I did n't get why in case of pre-emption allowed , Why there can be infinite combination , assuming that time quantum tends to 0 and Burst time tending to NP hard problems (a silly way to say infinte) , still  if one  of the process is scheduled by CPU then , if suspended it is not the responsiblity of CPU  again (long term schedular) to schedule it again, rather the duty of Middle term schedular.
+1 vote
by (269 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,324 answers
105,169 users