There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Mahadi Hasan wrote:Fred Rosenberger, in every object-oriented language there are some data structures that perform different actions with the best performance.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Mahadi Hasan wrote:[T]he ArrayList is good for searching with optimized time
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Yes, that operation runs in constant time. But it isn't what I would call searching.fred rosenberger wrote:. . . "find the item at position 1,248,423", then yes, an array list is very fast.
Unless you have a sorted list and use binary search, that search runs in linear time. I don't think that counts as terrible, but a hash‑based collection or map will find such an element much faster. As others have said, a DBMS will probably also be much faster. Horses for courses; you choose types of collection for their functionality rather than speed.. . . "find the element with "fred rosenberger" . . . it is terrible.
Hahahahahahahahaha!. . . toxic ooze.
Campbell Ritchie wrote:
Yes, that operation runs in constant time. But it isn't what I would call searching.fred rosenberger wrote:. . . "find the item at position 1,248,423", then yes, an array list is very fast.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Blood pressure normal? What do I change to get "magnificent"? Maybe this tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|