Pattern recognition : an algorithmic approach