From charlesreid1

Revision as of 18:22, 2 June 2017 by Admin (talk | contribs) (Created page with "Main abstract data types: * Lists * Maps/Dictionaries * Sets * Stacks * Queues * Trees These are basic types of data structures (although some of the data types above may uti...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Main abstract data types:

  • Lists
  • Maps/Dictionaries
  • Sets
  • Stacks
  • Queues
  • Trees

These are basic types of data structures (although some of the data types above may utilize other data types in their implementation, e.g., a linked list structure used to store a dictionary).

Lists

Array list data type

Dynamically expanding array list type.

Header 1 Header 2 Header 3
row 1, cell 1 row 1, cell 2 row 1, cell 3
row 2, cell 1 row 2, cell 2 row 2, cell 3

Linked list data type

Linked data structures: much/most of the data in a linked list data type is dedicated to links/addresses

Main differences in implementation of linked list types are in the links themselves. Doubly linked lists have simpler algorithms and are easier to implement, but come with the extra overhead of additional pointers.

Operation Singly Linked List Doubly Linked List Singly Linked List, Sorted Doubly Linked List, Sorted
Search(L,k) O(n) O(n) O(n) O(n)
Insert(D,x) O(1) O(1) O(n) O(n)
Delete(L,x) O(n)* O(1) O(n)* O(1)
Successor(L,x) O(n) O(n) O(1) O(1)
Predecessor(L,x) O(n) O(n) O(n)* O(1)
Minimum(L) O(n) O(n) O(1) O(1)
Maximum(L) O(n) O(n) O(1)* O(1)

Map/Dictionary

Dictionary data type

Flags