Implement the algorithm in serial, parallel and give speedup.