when to use what using commercial library may eliminate or at least reduce the programming necessary to create the data structures described in this book when that' the caseusing complex structure such as balanced treeor delicate algorithm such as quicksortbecomes more attractive possibility howeveryou must ensure that the class can be adapted to your particular situation arrays in many situations the array is the first kind of structure you should consider when storing and manipulating data arrays are useful when the amount of data is reasonably small the amount of data is predictable in advance if you have plenty of memoryyou can relax the second conditionjust make the array big enough to handle any foreseeable influx of data if insertion speed is importantuse an unordered array if search speed is importantuse an ordered array with binary search deletion is always slow in arrays because an average of half the items must be moved to fill in the newly vacated cell traversal is fast in an ordered array but not supported in an unordered array vectorssuch as the vector class supplied with javaare arrays that expand themselves when they become too full vectors may work when the amount of data isn' known in advance howeverthere may periodically be significant pause while they enlarge themselves by copying the old data into the new space linked lists consider linked list whenever the amount of data to be stored cannot be predicted in advance or when data will frequently be inserted and deleted the linked list obtains whatever storage it needs as new items are addedso it can expand to fill all of available memoryand there is no need to fill "holesduring deletionas there is in arrays insertion is fast in an unordered list searching and deletion are slow (although deletion is faster than in an array)solike arrayslinked lists are best used when the amount of data is comparatively small linked list is somewhat more complicated to program than an arraybut is simple compared with tree or hash table binary search trees binary tree is the first structure to consider when arrays and linked lists prove too slow tree provides fast (logninsertionsearchingand deletion traversal is