Best fit is actually an algorithm for finding holes and we know it simply does O(n) search to find it . By that logic , the following allocations happen immediately :
1) J1 goes to 2k partition (Completely filled)
2) J2 goes to 20k partition (6k space still left , i.e hole of size 6k)
3) J3 goes to 4K partition (1k space left , i.e hole of size 1k )
4) J4 goes to 8k partition (2k space left , i.e hole of size 2k)
When assigning J5 which is of size 6k , the holes are checked linearly . Refer to step 2 above , it has a 6k sized hole to be filled . So J5 is allocated to the remaining 6k space. Therefore following are the vacant spaces/holes in each partition.
1) partition (2k): 0 k
2) partition (20k) : 0 k
3) partition (4k) : 1 k
4) partition (8k) : 2k
Since J6 is 10k and there's no space left , it has no option but to wait till J2 (sized 14k) to finish it's execution. So by the end of 10 units of time partition (20k) has a hole sized 20k (14k from J2 and 6k from J5 , as both were allocated instantly) and J6 is fit into it. Note : by the end of 10 units all other partitions other than partition (20k) are empty as all it's processes are complete. Therefore following are the vacant spaces/holes in each partition.
1) partition (2k): 2 k
2) partition (20k) : 10 k
3) partition (4k) : 4k
4) partition (8k) : 8k
When assigning J7 which is of size 7k , the holes are checked linearly . Refer to step 4 above , it has a 8k sized hole/partition to be filled . So J5 is allocated to partition (8k).
Total time taken to complete J7 = 10(total wait) + 8(time taken by J7) = 18 .
At the end of 18th unit or beginning of 19th unit J7 is complete.