Implementation of various algorithms. Solutions to various text book questions