Re: Test If Int Has Not Been Set



Patricia Shanahan wrote:
3. Use a separate boolean array, the same length, and set the boolean at
an index to true when you set the int with the same index.

Or use a bit set to the same effect.

4. Structure your logic so that you only attempt to set each element once.

5. Don't use an integer array - assuming your algorithm produces a sparse vector. If this is the case consider a map with the index becoming the key.

/Thomas
--
The comp.lang.java.gui FAQ:
http://gd.tuwien.ac.at/faqs/faqs-hierarchy/comp/comp.lang.java.gui/
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
.



Relevant Pages

  • Re: [PATCH V2 2/3] powerpc: Add support for swiotlb on 32-bit
    ... static inline int ... nonforced_iommu(struct device *dev, unsigned long addr, size_t size) ... /* Map a single continuous physical area into the IOMMU. ... static int is_swiotlb_buffer ...
    (Linux-Kernel)
  • Re: Displaying a Map in a JTable
    ... >> thought of is transforming the Map to a 2D array, ... it is that the table model insist that you supply certain routines. ... public int getColumnCount() { ... public void setValueAt{ ...
    (comp.lang.java.programmer)
  • Re: Displaying a Map in a JTable
    ... >>> thought of is transforming the Map to a 2D array, ... >> in a 2D array and then passing it to a JTable constructor: ... > it is that the table model insist that you supply certain routines. ... an int index to retrieve data. ...
    (comp.lang.java.programmer)
  • Re: union find
    ... // Maps Element to nonnegative int. ... Map mapCreate; ... UnionFind ufCreate( ... Map a subset identifier to its current partition subset identifier. ...
    (comp.lang.c)
  • Re: Help Drawing into a Dialog
    ... You should not be doing any drawings in any method other than OnPaint. ... the map only calling the CDialog::OnInitDialogroutine. ... //for clear map no markrs ... int xposition = 194; ...
    (microsoft.public.vc.mfc)