| "faster for searching" - Let's be specific. Let's say you want to find item #432 – which is faster, Sets or Arrays? Now let's say you want to find the first item > 500 and 600. Which? Mark Guzdial |
| for finding item #432 : use set b/c you can hash to it immediately. for finding item based on criteria: use array b/c iteration is needed, and Arrays are much faster for iteration then a hash -Stephen Belknap |
| If OC's doubled their size with every insertion, they'd be really slow and huge. Mark Guzdial |
| Note: There are two parts there – growing and copying. Mark Guzdial |
| Not the 432nd element, but the element whose ID is #432. To find the 432nd element, yes, Arrays are O(1). But to find ID#432... Mark Guzdial |