Data Structures Flashcards
Features of an array
Fixed size(static) All items must be of same data type Fixed number of items Can have 1 or more dimensions Can hold an item of the other two structures
Features of tuples?
Number of items may grow or shrink
Items may be of different data types
a tuple is immutable-data cannot be modified
Features of records?
Fixed number of items
Items may be of different data types of record is accessed through an attribute
What is a list?
An ordered data structure
A list is accessed through an index
The index indicates the position of the data in the list
What are stacks?
LIFO structure
PUSH command to insert data
POP command to remove data
two pionter
What are queues?
FIFO structure
PUSH command to insert data
POP command to remove data
Define linked list?
Unordered data structure that uses pointers to sort data
Linked lists use pointers to sort data by pointing at the next item in the list. They use a start pointer and an end pointer that usually points to 0 or null. Linked lists can have multiple sets of pointers. Linked lists can have multiple sets of pointers to sort data on various attributes
What are binary trees?
Tree structure where each node can only have two branches left and right
What are graphs?
A collection of data nodes with connections between them
The graph may be directed or undirected
The graph may be weighted or unweighted
The graph may be directed or undirected
What is depth-first traversel?
Uses a stack to store visited nodes
Visit all nodes attached to anode connected to a starting node before visiting a second node attached to a starting node
What is breath-first traversel?
Uses a queue to store the visited nodes
Visit all nodes attached directly to a starting node first
What are hash tables?
Hash tables are used to access data that is stored in a more random manner. Each item maps to an address in a table containing data about that item.
Binary trees:
Preorder?
RLN
Binary trees:
Inorder?
LNR
Binary trees:
Postorder?
LRN