Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamicArray with initial size keeps null values #10

Closed
pitzzahh opened this issue Oct 10, 2022 · 1 comment
Closed

DynamicArray with initial size keeps null values #10

pitzzahh opened this issue Oct 10, 2022 · 1 comment
Labels
bug Something isn't working invalid This doesn't seem right question Further information is requested

Comments

@pitzzahh
Copy link
Owner

    /**
     * Creates a {@code DynamicArray} object with an initial size
     * @param initialSize the initial size of the array.
     */
    public DynamicArray(int initialSize) {
        if (initialSize > 0) this.balloon = new Object[initialSize];
        else if (initialSize == 0) this.balloon = new Object[]{};
        else throw new IllegalArgumentException("Illegal Capacity: " + initialSize);
    }

For removal, dynamic array size should increase based on the inserted elements

@pitzzahh pitzzahh added bug Something isn't working invalid This doesn't seem right question Further information is requested labels Oct 10, 2022
pitzzahh added a commit that referenced this issue Oct 11, 2022
@pitzzahh
Copy link
Owner Author

Fixed on commit: a99fa55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant