public void removeDuplicates(Node node) {

		Node root = node;

		if (root == null) {
			return;
		}

		System.out.println("Before duplicate removal:");
		print(root);

		while (root != null) {

			if (root.getData() == root.getLink().getData()) {
				Node ptr = root.getLink();
				while (ptr != null && ptr.getLink() != null
						&& (ptr.getData() == ptr.getLink().getData())) {
					ptr = ptr.getLink();
				}
				root.setLink(ptr.getLink());
			}
			root = root.getLink();
		}
		System.out.println("After duplicate removal");
		print(node);
	}