public boolean hasLoops( ListNode head ) {

		  if (head==null)
			  return false;
		  ListNode pt1 = head.next;
		  if (pt1==null)
			  return false;
		  ListNode pt2 = head.next.next;
		  while(pt1!=null && pt2!=null){
			  if (pt1==pt2)
				  return true;
			  pt1=pt1.next;
			  pt2=pt2.next;
			  if(pt2!=null)
				  pt2=pt2.next;
			  			  			  	  
		  }
		  
		  return false;	  
	 }