"Shortest job first" is not really an algorithm, but a strategy: among the jobs ready to execute always choose the job with the shortest execution time. Your sequence looks ok. In the beginning the following jobs are ready for execution (with execution time in parenthesis):
A1(10), B1(3), C1(8)
So B1
is chosen, after which also job B2
is ready to execute, so here is the updated list of ready jobs:
A1(10), B2(9), C1(8)
Now C1
is chosen, and so on.
There are variants of the strategy "shortest job first", where the total time over all bursts, i.e. A1 + A2
, B1 + B2
, ..., is taken into account. Then the chosen sequence would be:
B1, B2, A1, A2, C1, C2