Data Structures Flashcards

1
Q

Data Structures

A

Containers within which information is stored

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Arrays

A
  • An indexed, finite set of elements with the same data type
  • Can be created in many dimensions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Files

A

A collection of data stored permenantly on secondary storage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Abstract Data Types

A
  • Don’t exist as data structures in their own right
  • Uses other data structures to form a new way of storing data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Queues

A
  • A FIFO abstract data type that is based on an array
  • Used in keyboard buffers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Linear Queues

A
  • A fixed length queue with a front and rear pointer
  • Once a space has been used it cannot be reused until the queue is reset
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Circular Queues

A

A queues where the front and rear pointers can move over the 2 ends of the queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Queue Operators

A

Enqueue, Dequeue, IsEmpty, IsFull

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Priority Queues

A
  • Items are assigned a priority that determines when they are dequeued
  • Uses a FIFO system for items with equal priority
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Stacks

A
  • A FILO abstract data type that is based off an array
  • Has a single pointer (the top pointer)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Stack Operations

A

Push, Pop, Peek, IsFull, IsEmpty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Stack Overflow

A

Error that occurs when a push command is executed on a full stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Stack Underflow

A

Error that occurs when a pop command is executed onto an empty stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Graph

A

An abstract data type comprising of nodes (entities) connected by edges (relationships)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Weighted Graph

A
  • A graph where each edge has an assigned value
  • Represented by adjacency matrices or adjacency lists
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Adjacency Matrices

A
  • A tabular representation of a graph
  • Each node is assigned a row and column
17
Q

Adjacency List

A
  • Represents a graph using a list
  • Each node has a list of adjacent nodes
18
Q

Adjacency List vs Matrix

A
  • Adjacency matrices store every possible edge, even those that do not exist
  • Adjacency lists are slow to query as each item in a list must be searched sequentially
  • Adjacency matrices are suited to dense graphs with high amounts of edges
19
Q

Tree

A

A connected, undirected graph with no cycles

20
Q

Rooted Tree

A

A tree with a root node

21
Q

Root Node

A

The node from which all other nodes stem

22
Q

Parent Node

A

A node from which other nodes stem

23
Q

Child Node

A

A node with a parent node

24
Q

Leaf Node

A

A child node with no children

25
Binary Tree
A rooted tree where each parent node has no more than 2 child nodes
26
Hash Tables
- A way of storing data with constant time complexity - Uses a hashing algorithm to return a hash - The hash is the index of the key-value pair
27
Hashing Algorithm
An algorithm that takes an input and returns a hash
28
Hash
- Each hash is unique to its input - They cannot be reversed to retrieve the input value
29
Collision
- Where different inputs produce the same hash - Can be avoided by using rehashing
30
Dictionaries
- Collections of key-value pairs - Values are accessed by their associated key
31
Static Data Structures
- Fixed in size - Declared in memory as a series of sequential, contiguous memory locations
32
Dynamic Data Structures
- Change in size to store their content - Store each piece of data alongside a reference to where the next item is stored in memory