public void rotateACW(Node root, int n) {

		if (root == null || n <= 0) {
			return;
		}

		int size = size(root);
		if (n == size) {
			// no need to rotate, as it will be the same
			System.out.println("List after rotating");
			print(root);
			return;
		}

		if (n > size) {
			n = n % size;
		}

		System.out.println("List Before rotating");
		print(root);

		Node ptr = root;
		Node ptr1 = null;

		while (n-- > 0) {
			ptr1 = ptr;
			ptr = ptr.getLink();
		}

		Node temp = ptr;

		while (temp.getLink() != null) {
			temp = temp.getLink();
		}

		temp.setLink(root);
		ptr1.setLink(null);
		root = ptr;

		System.out.println("List after rotating");
		print(root);

	}