can anyone tell me why i am getting segmentation error , though my time complexity is big oh of n , plzz help