70 likes | 152 Vues
This slide show compares 1-D arrays, linearly linked lists, and binary search trees in terms of insertion, deletion, and searching operations. It discusses the advantages and disadvantages of each data structure. Binary search trees are highlighted as the most advantageous option. Visit the last slide for a summary sheet.
E N D
Data Structures 1-D arrays, linearly-linked lists and binary search trees
Overview This slide show discusses 1-D arrays and compares them with two sorts of linked list, linearly linked lists and binary search trees in regard to their properties in relation to (a) insertion, (b) deletion and (c) searching.
1-D arrays • Can’t dynamically grow and shrink. (-) • Difficult to insert and delete. (-) • Extraordinarily good searching of sorted arrays, of the order of log2n where n is the number of elements in the array. (+)
Linear linked lists • Can grow and shrink dynamically.(+) • Easy to insert and delete. (+) • Extremely bad search time, making them useless if used to provide long lists. (-)
Binary Search Trees • Can grow and shrink dynamically. (+) • Easy to insert and delete. (+) • Easy to search, even for extremely long lists. (+)
Conclusion Binary search trees come out on tops as having all the advantages and none of the disadvantages. Now go to the last slide to see the summary sheet.