Refactored common Priority and SJF algorithm code into BasePrioritizedSchedulingAlgorithm base class.