Fundamentals of Data Structure Flashcards

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

Abstract Data Type

A

A conceptual model of how the data is stored and the operations that were performed upon them.

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

Static Data Structure

A

A method of storing data where the amount of data stored (and memory used to store it) is fixed.

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

Dynamic Data Structure

A

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.

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

Stack

A

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.

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

Stack Frame

A

A collection of data about a subroutine call

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

Call Stack

A

A special type of stack used to store information about active subroutines and functions within a program

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

Recursion

A

The process of a subroutine calling itself

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

Stack Pointer

A

A small register that stores the address of the last program request in a stack.

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

Queue

A

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.

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

Linear Queue

A

http://image.ibb.co/dgKP0y/20180603_155036.jpg

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

Circular Queue

A

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.

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

Priority Queues

A

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.

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

Graph

A

A mathematical structure that models the relationship between pairs of objects.

A tree is similar to a graph, but with no loops.

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

Arc/Edge

A

Join/show relationship between 2 nodes

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

Vertex/Vertices

A

An object in a graph - also known as a node

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

Weighted Graph

A

A graph with data values on each arc/edge

17
Q

Graph/Weighted graph/Undirected Graph/Directed Graph

Draw examples of each one.

A

http://image.ibb.co/b7ksnd/20180603_155953.jpg

18
Q

Adjacency List

A

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

19
Q

Adjacency Matrix

A

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

20
Q

Binary Tree

A

A tree where each node can only have up to two child nodes attached to it.

21
Q

Hashing Algorithm

A

Code that creates a unique index from given items of key data

22
Q

Hash Table

A

A data structure that stores key/value pairs based on an index calculated from an algorithm

23
Q

Uses of hashing algorithms

A

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

24
Q

Collision

A

When a hashing algorithm produces the same index for two or more different keys

25
Q

Clustering

A

When a hashing algorithm produces indices that are not randomly distributed.

26
Q

Index

A

The location where values will be stored, calculated from the key.

When collision occurs, there must be some way of handling it so that a unique index can be assigned to the key:
Chaining - adding the key/value to a list stored at the same index.
Rehashing - The process of running the hashing algorithm again when a collision occurs. This normally uses a technique called probing, which means that the algorithm probes or searches for an empty slot, and uses it.

27
Q

Dictionary (Data Structure)

A

An abstract data type that maps keys to data. It is called an associative array in that it deals with two sets of data that are associated with each other.
eg
http://images.slideplayer.com/16/4911256/slides/slide_3.jpg

28
Q

Representing vector as a data structure

A

eg
fibonacci[0] = 0; fibonacci[1] = 1; fibonacci[2] = 1

in a dictionary, would be represented as
{0:0, 1:1, 2:1}

29
Q

Vector Addition

A
A = (A1, A2, A3)
B = (B1, B2, B3)

A + B = (A1+B1, A2+B2, A3+B3)

30
Q

Dot Product

A
A = (3,5)
B = (7,2)

A.B = 37+52 = 31

31
Q

Convex Combinations

A
The convex combinations is inbetween the two vectors.
It is calculated as au+Bv
Where u and v are vectors
a+B = 1
a and B must be 0 or greater

https://www.youtube.com/watch?v=6N_caSzNpkc