Data Structures Overview Terms & Concepts Flashcards
array
primitive data structure
collection of items
stored sequentially
array insertion
new value placed in arbitrary position
all following elements move over one position to make room
array index
access any item
abstract data type (ADT)
a scheme for organizing data that is independent of how it is stored in the computer
defined by a name and list of operations that can be performed on it
List ADT operation: Size
get the number of items in the list
List ADT operation: Get
get the value at a specific location
List ADT operation: Find
find the location of a matching element
List ADT operation: insert
put a new value into the list at a specific location
List ADT operation: remove
take a value out of the list at a specific location
List ADT operation: Set
replace one item with another
big-O notation
tool for measuring operation execution speed
dependent on data type and implementation
“order of”
Efficiency of List ADT Size operation implemented with an array
O(1)
Efficiency of List ADT Get operation implemented with an array
O(1)
Efficiency of List ADT Find operation implemented with an array
O(n)
Efficiency of List ADT Set operation implemented with an array
O(n)
Efficiency of List ADT insert operation implemented with an array
O(n)
Efficiency of List ADT Add at end operation implemented with an array
O(1)
Efficiency of List ADT Remove operation implemented with an array
O(n)
Efficiency of List ADT Sort operation implemented with an array
O(n log n)
Efficiency of Ordered List ADT Size operation implemented with an array
usually O(1)
Efficiency of Ordered List ADT Get operation implemented with an array
O(1)
Efficiency of Ordered List ADT Find operation implemented with an array
O(log n)
Efficiency of Ordered List ADT Insert operation implemented with an array
O(n)
Efficiency of Ordered List ADT Remove operation implemented with an array
O(n)
Set ADT
like a list that doesn’t allow duplicates, but the position of items in the collection is undefined and irrelevant.
Set ADT operations
Add, In, Intersection, Union
Set ADT operation: Add
add an item to the set