* @param depth
	 *            depth of the node.
	 * @return node created.
	 */
	private static TreeNode createNode(List<LAB> LABValues, int k, int depth) {
		// Check if the List is empty
		if (LABValues == null || LABValues.size() == 0)
			return null;

		int axis = depth % k;

		// Sort the values based on the AXIS
		if (axis == AXIS_L)
			Collections.sort(LABValues, COMPARE_L);
		else if (axis == AXIS_A)
			Collections.sort(LABValues, COMPARE_A);
		else
			Collections.sort(LABValues, COMPARE_B);

		// Get Median to decide the root
		int medianIndex = LABValues.size() / 2;

		TreeNode node = new TreeNode(k, depth, LABValues.get(medianIndex));

		if (LABValues.size() > 0) {
			// Recursively Build the tree for left subtree.
			if ((medianIndex - 1) >= 0) {
				List<LAB> lesserNodes = LABValues.subList(0, medianIndex);

				if (lesserNodes.size() > 0) {
					node.lesser = createNode(lesserNodes, k, depth + 1);
					node.lesser.parent = node;
				}
			}
			// Recursively Build the tree for right subtree.
			if ((medianIndex + 1) <= (LABValues.size() - 1)) {
				List<LAB> greaterNodes = LABValues.subList(medianIndex + 1,
						LABValues.size());
				if (greaterNodes.size() > 0) {
					node.greater = createNode(greaterNodes, k, depth + 1);
					node.greater.parent = node;
				}
			}
		}

		return node;
	}