private void quicksort(int begin, int end, boolean coord) {
		int i = begin;
		int j = end;
		RoutingEntry middle;

		if (end > begin) {
			int index = (begin + end) / 2; 
			middle = (RoutingEntry)vector.elementAt(index);

			while (i <= j) {
				while (i < end && compare(i, middle, coord) < 0)
					i++;

				while (j > begin && compare(j, middle, coord) > 0)
					--j;

				if (i <= j) {
					swap(i, j);
					++i;
					--j;
				}
			}
			
			if (begin < j)
				quicksort(begin, j, coord);

			if(i < end)
				quicksort(i, end, coord);

		}
	}