public void remove(int listID, int index) {
        if ((listID < 0) || (listID >= numLists)) {
            throw new IndexOutOfBoundsException("The listID is out of bounds");
        }
        if ((index < 0) || (index >= capacity)) {
            throw new IndexOutOfBoundsException();
        }

		int head = heads[listID];

        if (head == END_OF_LIST) {
            return;
        }

        // the special case that the index to be removed is the first one in
        // the list.
        if (head == index) {

            int temp = links[head];
            free(head);
			heads[listID] =temp;
            return;
        }

        int ptr = head;
        // search for the index in the list.  If the end of the list is
        // reached, then the index is not in the list and we don't care.
        while (links[ptr] != END_OF_LIST) {
            if (links[ptr] == index) {
                // found the index to be deleted, remove it from the list by
                // fixing the preivous index's link to skip the removed index.
                links[ptr] = links[index];
                free(index);
				break;
			}
            ptr = links[ptr];
        }

        return;
	}
Remove the index resource from the linked list indexed by listID.
@param listID the id of the list from which to removed the value at index.
@param index the index of the value to be removed from the specified list.
@exception IndexOutOfBoundsException thrown if the listID is not in the
the range [0, numLists).
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/IntListIndexer.java