private static ListNode merge(ListNode leftlist,ListNode rightlist){
		 
		 ListNode head,currentNode, nextNode;
		 
		 if(leftlist == null)
			 return rightlist;
		 else if(rightlist == null)
			 return leftlist;
		 else if(leftlist.val <= rightlist.val){
			 head = leftlist;
			 currentNode = leftlist;
			 nextNode = rightlist;
		 } else {
			 head = rightlist;
			 currentNode = rightlist;
			 nextNode = leftlist;
		 }
		 
		 ListNode temp;
		 
		 while(nextNode !=null){
			 if(currentNode.next == null){
				 currentNode.next = nextNode;
				 nextNode = null;
			 }
			 else if(currentNode.next.val <= nextNode.val){
				 currentNode = currentNode.next;
			 } else {
				 temp = currentNode.next;
				 currentNode.next = nextNode;
				 nextNode = temp;
			 }
		 }
		 
		 return head;
	 }