Data structures Flashcards

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

abstract data type

A

Logical description of how we view the data and possible operations

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

4 operations of a queue

A

Add item to the rear of the queue
Remove item from the front of the queue
Check if the queue is empty
Check if the queue is full

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

Dynamic data structure

A

Allocates and deallocates memory from the heap
Excessive allocation of memory with our deal location may cause overflow
Python- list

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

Static data structure

A

Cannot grow shrink or be freed during execution
An array is a static data structure

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

4 operations of stack

A

Add an item to the top
Remove an item from the top
Check if the stack is full
Check if the stack is empty

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

Pseudo code for stack

A

Push - adds item to the top of the stack
Pop - removes and returns the item on the top of the stack
Is full - checks if the stack is full
Is empty - checks if the stack is empty

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

Underflow

A

Attempting to pop from a stack that is empty

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

What is the call stack

A

System level data structure
Provides mechanism for passing parameters and return addresses to subroutines
Call stack is hidden in high level languages

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

Subroutine calls in the call stack

A

The parameters are saved unto the stack
Local variables are saved onto the stack
Address to which execution returns after the end of the subroiutine is saved onto the stack
Execution is transferred to subroutine code

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

Subroutine execution in the call stack

A

Stack space is allocated for local variables
Subroutine code executes
Return address is retrieved
Parameters are popped
Execution is transferred back to the return address

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

What is a collision

A

When an algorithm generates the same address for different primary keys

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

What is the midsquare method

A
  • first square the item
  • extract some portion of the resulting digits
  • perform the mod step to get an address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

the folding method

A
  • divide the item into equal size pieces
  • add the pieces together
  • perform the mod step to get an address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is an undirected graph

A

it is undirected because there are no arrows on the edges indicating direction

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

definition of a tree

A

tree is connected undirected graph with no cycles

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