Characteristics of Data Structures
Characteristics of Data Structures
Collections Framework
Slow search
Quick insertion
Slow deletion
Array Very fast access of index if known.
Fixed Size
Quick insertion,
Linked list Slow search.
Quick deletion
ARRAY
INDEX BASED, NULLS, DUPLICATES AND ANY OTHER DATA TYPES ARE ALLOWED. THERE IS
NO ORDERING ENFORCED.
Because it has no concept of enforcing data types, it allows Integers, Strings, Objects, etc. Since it has to traverse
every type, it is slower to look for, or delete an item. Allowing duplicates complicates the search algorithm, as we
noted. Even if it finds a match, it must continue looking for possible additional matches until the last occupied cell.
At least, this is one approach; you could also stop after the first match. How you proceed depends on whether the
question is “Find me everyone with blue eyes” or “Find me someone with blue eyes.”