Fundamentals of Data Structure Flashcards
(31 cards)
Abstract Data Type
A conceptual model of how the data is stored and the operations that were performed upon them.
Static Data Structure
A method of storing data where the amount of data stored (and memory used to store it) is fixed.
Dynamic Data Structure
A method of storing data where the amount of data stored (and memory used to store it) will vary as the program is being run.
Stack
A stack is an example of LIFO
A stack in a computer works exactly as a stack of books waiting to be marked - whichever item was added to the top is the first to be dealt with. However, data dealt with is NOT removed from the stack. What happens is that a variable called the stack pointer keeps track of where the top of the stack is.
Data is ‘pushed’ onto the stack or is ‘popped’ from the stack.
Stack Frame
A collection of data about a subroutine call
Call Stack
A special type of stack used to store information about active subroutines and functions within a program
Recursion
The process of a subroutine calling itself
Stack Pointer
A small register that stores the address of the last program request in a stack.
Queue
A queue is an example of FIFO
FIFO - First in First out (where the first data item is first to leave)
A common use for queues is when sending a document to the printer.
Linear Queue
http://image.ibb.co/dgKP0y/20180603_155036.jpg
Circular Queue
http://image.ibb.co/kO8j0y/20180603_155042.jpg
A common implementation for Circular Queue is for buffering, when items of data need to be stored temporarily while they are waiting to be passed to/from the device.
Priority Queues
A variation of a FIFO structure where some data may leave out of sequence where it has a higher priority than other data items.
Example: If documents are being sent to a printer on a network, the administrator may be able to control the queue.
Graph
A mathematical structure that models the relationship between pairs of objects.
A tree is similar to a graph, but with no loops.
Arc/Edge
Join/show relationship between 2 nodes
Vertex/Vertices
An object in a graph - also known as a node
Weighted Graph
A graph with data values on each arc/edge
Graph/Weighted graph/Undirected Graph/Directed Graph
Draw examples of each one.
http://image.ibb.co/b7ksnd/20180603_155953.jpg
Adjacency List
A data structure that stores a list of nodes with their adjacent nodes.
http: //image.ibb.co/exjP0y/20180603_160223.jpg
http: //image.ibb.co/dRD3Sd/20180603_160343.jpg
Adjacency Matrix
This uses a two-dimensional array or grid populated with 1s and 0s
http: //image.ibb.co/hNigDJ/20180603_160355.jpg
http: //image.ibb.co/jLOWDJ/20180603_160359.jpg
Binary Tree
A tree where each node can only have up to two child nodes attached to it.
Hashing Algorithm
Code that creates a unique index from given items of key data
Hash Table
A data structure that stores key/value pairs based on an index calculated from an algorithm
Uses of hashing algorithms
Databases - Used to create indices for databases enabling quick storage and retrieval of data (more efficient than linear for example)
Memory addressing - Used to generate memory addresses where data will be stored
Collision
When a hashing algorithm produces the same index for two or more different keys