Vous êtes sur la page 1sur 2

Characteristics of Data Structures

Collections Framework

Data Structure Advantages Disadvantages

 Slow search
 Quick insertion
 Slow deletion
Array  Very fast access of index if known.
 Fixed Size

 Quicker search than unsorted  Slow insertion and deletion,


Ordered Array
array. fixed size.
 Provides last-in, first-out access.
Stack  Slow access to other items.
Also known as (LIFO)
Queue  Provides first-in, first-out access.  Slow access to other items.

 Quick insertion,
Linked list  Slow search.
 Quick deletion

 Quick search, insertion, deletion (if


Binary tree  Deletion algorithm is complex.
tree remains balanced).
 Quick search, insertion, deletion.
Red-black tree  Complex.
Tree always balanced
 Quick search, insertion, deletion.
2-3-4 tree Tree always balanced. Similar  Complex.
trees good for disk storage.
 Very fast access if key known.
Hash table  Slow deletion.
Fast insertion.
 Fast insertion, deletion, access to
Heap  Slow access to other items.
largest item.
 Some algorithms are slow and
Graph  Models real-world situations
complex.
 

 

 
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.”

Vous aimerez peut-être aussi