1.4.2 Data Structures Flashcards

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

what does dynamic and static mean

A

Dynamic - size can change
Static - Size cannot change

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

how does a stack work

A

First in last out
adds data to the top of the stakc

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

What are the operations for a stack

A

push -add item to the top
Pop - remove item from the top
isfull - check if stack is full
isEmpty - check stack is empty

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

define array

A

A data structure where a contiguous section of data is allocated to RAM
Single data type

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

define record

A

Multiple values under one identifier can be different data types
row in a table

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

what are the features of a list

A

Mutable (items can change)
can store multiple data types

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

What are the features of an Array

A

Mutable (items can change)
only one datatype

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

What are the features of a Tuple

A

Immutble (items cant change)
can store multiple data types

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

define graph

A

an abstract data structure representing complex relationships

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

what are the features of a graph

A

not heirarchial
can be directed
can be weighted
can have cycles or loops

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

what are the characteristics of a tree

A

Heircahial data structure
Data stored in nodes
Has leaf nodes
no cycles or loops

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

why use a hash table

A

when searching through a large data set binary search becomes exponentially quicker
but may take a long time to sort data
however a hash table can find an address almost instantly

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

what are the four key operations on a Queue

A

Append - enqueue
dequeue
isEmpty
isFull

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

describe how an array can be used ot store and access data in a stack [4]

A

Pointer to the next free space (top of the stack)
when data added
added to pointer position/pointer+1
check if stack is full
pointer incremented
when removing data
check empty
pointer = pointer -1
pop and push

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