Unit 2 Flashcards

(39 cards)

1
Q

array

A

data structure which contains several items of the same data type
-can be thought of as table, with bounds (0-n) and index/subscript

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

tuple

A

ordered list of elements

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

initializing an array

A

amount of space needed has to reserved
+change bounds to change num of elements
+declare elements in one statement
+loop structures for quick proccessing
+single identifier

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

list

A

abstract data structure and dynamic

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

records

A

different data types, data structure which consists of a collection of elements, each separate item is a field (fixed length)

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

file

A

each row is a record, each separate item (piece of data) in record is called field
-all records have the same number of fields and all fields have same fata type
-need a key field or primary key

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

initializing an array

A

int[] Votes = new int[4]

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

static

A

cannot change size while program is running (array)

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

dynamic

A

can change size as program is running (linked list, tree)

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

data held serially

A

points to next item in list

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

data held sequentially

A

points to next item of data in alphabetical order

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

pointer

A

indicating the address of the start of the list

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

linked list

A

not all space in use,free space indicated as list and used for other things

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

heap

A

memory space allocated for data structure to grow

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

queue

A

first in first out data structure, front and rear pointer (when empty rear pointer is -1), circular queues override date, priority queue

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

stack

A

last in first out

17
Q

graph

A

dynamic data structure commonly used to represent several types of data network

18
Q

dense

A

more edges than nodes

19
Q

sparse

A

more nodes than edges

20
Q

weighted

A

edges are given values

21
Q

directed

A

edges given direction

22
Q

node

A

the point with the information you want to get

23
Q

edges

A

how you get from one node to the next (lines)

24
Q

degree

A

how many edges come off a node

25
bidirectional
edges without arrows
26
adjacency matrix
stores graphs as matrix (symmetrical for undirected graph) +simple to implement as 2D array +quick to add edges and check for existence +best for dense graphs with changing edges -static
27
adjacency list
stores graph as list +memory efficient for large sparse graphs +easy to add and delete nodes
28
tree
connected, undirected graph without cycles
29
root
parent node, parent-child relationship with all other nodes
30
binary tree
rooted with each node having at most two children
31
traverse
if lower than current root: left, if higher: right and then insert data at correct place
32
deleting nodes
mark as deleted to keep structure or delete and copy into new tree
33
hash table
data structure which creates a mapping between keys and values, used when data needs to be found quickly
34
hashing algorithm
decides location in which item gets stored -each item stored in a numbered or indexed slot
35
collision
when hashing algorithm produces 2 same key values for different things
36
what to do with collision
-linked list (chaining), a overflow structure -rehashing, another hashing algorithm or next available space, can take up processing time
37
adding items with hashing algorithm
input item, perform the algorithm, output hash value h as storage location and store item there
38
searching for item with hashing algortihm
input s to find, perform algorithm on s, output h as storage location, if item there matches s, output required data
39
dictionaries
a collection of key-value pairs in which the value is accessed via associated key -more abstract than hashing algorithm -built in data types -data in pairs, first item is key, the other item is the value