public void delElemAt(int index) {
		if (index >= count || index < 0)
			throw new IndexOutOfBoundsException(
					"Incorrect index or the array does not exist");
		if (count == 1) {
			head = null;
			tail = null;
		}
		if (index == 0) {
			head = head.next;
			head.prev = null;
			count--;
			return;
		}
		if (index == count-1) {
			tail = tail.prev;
			tail.next = null;
			count--;
			return ;
		}
		if (index < count / 2) {
			Node n = head;
			for (int i = 0; i < index - 1; i++)
				n = n.next;
			n.next = n.next.next;
			n.next.prev = n;
		} else {
			Node n = tail;
			for (int i = count - 1; i > index + 1; i--)
				n = n.prev;
			n.prev = n.prev.prev;
			n.prev.next = n;
		}
		count--;

	}