static Dataset merge(Dataset left, Dataset right) {
			Dataset data = new Dataset(left.instances);
			int lSize = left.instances.size();
			for (Instance instance : left.instances) {
				data.instances.add(instance);
			}
			for (Instance instance : right.instances) {
				data.instances.add(instance);
			}
			for (int k = 0; k < left.sortedLists.size(); k++) {
				List<IntDoublePair> lSortedList = left.sortedLists.get(k);
				List<IntDoublePair> rSortedList = right.sortedLists.get(k);
				List<IntDoublePair> sortedList = new ArrayList<>(data.instances.size());
				int i = 0;
				int j = 0;
				while (i < lSortedList.size() && j < rSortedList.size()) {
					IntDoublePair l = lSortedList.get(i);
					IntDoublePair r = rSortedList.get(j);
					if (l.v2 < r.v2) {
						sortedList.add(l);
						i++;
					} else if (l.v2 > r.v2) {
						r.v1 += + lSize;
						sortedList.add(r);
						j++;
					} else {
						sortedList.add(l);
						r.v1 += lSize;
						sortedList.add(r);
						i++;
						j++;
					}
				}
				while (i < lSortedList.size()) {
					IntDoublePair l = lSortedList.get(i);
					sortedList.add(l);
					i++;
				}
				while (j < rSortedList.size()) {
					IntDoublePair r = rSortedList.get(j);
					r.v1 += lSize;
					sortedList.add(r);
					j++;
				}
				data.sortedLists.add(sortedList);
			}
			
			return data;
		}