public Node<Integer> merge(Node<Integer> head1, Node<Integer> head2) {
		Node<Integer> head = null;
		Node<Integer> p = head;
		Node<Integer> p1 = head1;
		Node<Integer> p2 = head2;

		while (p1 != null && p2 != null) {
			if (p1.data <= p2.data) {
				if (head == null) {
					head = p1;
					p = head;
				} else {
					p.next = p1;
					p = p.next;
				}
				p1 = p1.next;
			} else {
				if (head == null) {
					head = p2;
					p = p2;
				} else {
					p.next = p2;
					p = p.next;
				}
				p2 = p2.next;
			}
		}

		while (p1 != null) {
			p.next = p1;
			p = p.next;
			p1 = p1.next;
		}

		while (p2 != null) {
			p.next = p2;
			p = p.next;
			p2 = p2.next;
		}

		return head;
	}