Creating an array of bitArray

Hi, I want to create an array of BitArray(i.e. BitArray[]) and with each BitArray having a size of n. Is it possible Thanks

Currently I'm using this.

            BitArray[] a = new BitArray[numVar];
            for (int i = 0; i < numVar; i++) {
                a[ i ] = new BitArray(numProc);
            }

Would there be a better way



Answer this question

Creating an array of bitArray

  • toniSQL

    Right, creating objects is always a O(n) operation. Is that a problem



  • LutherW

    what if numVar is >1000 I will have to iterate 1000 times to set the size of each BitArray. In this manner, my complexity will be O(n)

  • Klgsx

    No



  • Jens-Christian Larsen

    I meant can I skip the iterative step

  • yanivpinhas

    Not really. What's wrong with the way you're doing it now



  • Creating an array of bitArray