Practise problems on Time complexity of an algorithm