title: First Come First Serve Wait Time Algorithm
body: <p>As i understand FCFS does not need any sorting but there are no examples covered in the internet what happens if waiting time goes negative?</p>
  
  <p>So i understand that algorithm for waiting time is: WT = CT (Completion Time) - AT (Arrival Time) - BT (Burst Time).
  But what happens if i have:</p>
  
  <pre><code>AT: 0 / BT: 2
  AT: 0 / BT: 4
  AT: 15 / BT: 5
  AT: 21 / BT: 10
  </code></pre>
  
  <p>My calculations would be:</p>
  
  <pre><code>WT = 2 - 0 - 2 = 0
  WT = 6 - 0 - 4 = 2
  WT = 11 - 15 -5 = -9
  WT = 21 - 21 - 10 = -10
  Avg: (0+2-10-9)/4 = -17/4  = -4,25 (seems unreal)
  </code></pre>
  
  <p>Is the correct answer negative or should i modify the algorithm somehow?</p>