Data Structures Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Define static data structures (e.g. arrays)

A

A static data structure has a fixed size so can waste or run out of space; fixed region of main memory so element can be directly accessed (by index number) as always in the same place.

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

Define dynamic data structures (e.g. linked lists)

A

A dynamic data structure can grow; each index made up of data and point to the next index. Needs external point (start) to first index and the last index has a null pointer.

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

Define a pointer in terms of data structures

A

A reference variable that contains a memory location.

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

Define a heap in terms of data structures

A

Memory available to applications / programs for dynamic allocation at runtime.

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

Define memory leakage in terms of data structures

A

Memory locations not returned to heap when no longer referenced.

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

Define an abstract data type

A

A complex data type that exists in the real world.

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

Define a stack as a data structure

A

A LIFO (Last in, First out) data structure. Needs 1 pointer at the top of stack. Used to store a functions data when another is called using a stack frame.

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

Define the methods a stack should have

A
Push - Adding to a stack. 
Pop - Removes from a stack.
Peek - Allows top item to be viewed. 
IsEmpty - Check if the stack is empty.
IsFull - Check if the stack is full.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define a queue as a data structure

A

A FIFO (First in, First out) data structure. Needs a pointer at the head (start) and at the tail (end) of the queue. (Can be linear or circular).

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

Define a priority queue as a data structure

A

Elements join after all others of same priority and / or before those of lower priority.

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

Define a graph as a data structure

A

An ADT (Abstract data type) that is a set of nodes (vertices) and connections between them known as edges (arcs). Can be used to represent computer and social networks, maps, mazes etc. Can be directed and / or weighted.

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

Suggest when to use an adjacency matrix to store a graphs data

A

if the number of edges are large compared to fewer nodes (makes it quicker to search).

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

Suggest when to use an adjacency list to store a graphs data

A

if the number of edges / connections are fewer compared to more nodes.

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

Define a tree in terms of data structures

A

A graph that is fully connected, undirected with no cycles

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

Define a rooted tree in terms of data structures

A

A tree where one node (vertex) is designated as the root with every edge (arc) directed away from the root

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

Define a binary tree in terms of data structures

A

A rooted tree where each parent has at most two children, efficient for searching and sorting.

17
Q

Define a hash table in terms of data structures

A

An ADT (Abstract data type) that is a table to store data efficiently.

18
Q

Define a hashing algorithm in terms of data structures

A

An algorithm that hashes a key into an index value that is used as the placement of the item in the hash table. A bad algorithm can cause collisions.

19
Q

Define a dictionary in terms of data structures

A

A collection of key/value pairs. Values are accessed via key.

20
Q

Define a vector in terms of data structures

A

A vector is a type of one dimensional array that instead of a normal array, it uses its own memory management mechanisms.