Chapter 8--abstract Data Types & Subprograms Flashcards

0
Q

Data structure?

A

The implementation of a composite data field in an abstract data type

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

Abstract data type?

A

A container whose properties are specified independently of any particular implementation

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

Discuss stacks.

A

LIFO. Adding an item is called a “push”. Removal is called a “pop”.

We do need operations that check if a stack is empty, because popping an empty stack would cause an error.

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

Give the multiple names for adding and removing queue items.

A

Enqueue, enque, enq, enter, insert.

Dequeue, deque, deq, delete, remove

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

List the 3 properties of lists.

A

The items are homogeneous, linear, and lists have varying lengths

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

Name some common list operations.

A

Insert, delete, check if an item is there (IsThere), and get number of total list items (GetLength). Also viewing items in sequence (Reset, GetNext, MoreItems).

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

Linked structure?

A

An implementation of a container where the items are stored together with information on where the next item is.

A list can be thought of as a linked structure. Linked structures contain nodes, which contain 2 things–the user’s data and info on where to find the next node.

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

What does the end of a list consist of?

A

A link that contains “null”, which is indicated by a /

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

What is a binary tree node that has no children called?

A

A leaf node

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

Binary search tree?

A

The value in any node is greater than any value in its left sub tree, and less than any value in its right subtree

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

“Parameter list”?

A

A list of identifiers or values with which the Subprogram is to work. It appears in parenthesis beside the Subprogram name.

It is a mechanism for communicating between two parts of a Subprogram.

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

Parameters? Give alternate name as well.

A

A.K.A. formal parameters. They are identifiers that appear in parentheses beside the Subprogram name.

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

Arguments?

A

The identifiers listed in parenthesis on the Subprogram call; a.k.a. actual parameters.

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

What is the most common way that arguments are substituted for parameters on a Subprogram call?

A

Position

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

Define/name the two types of called parameters.

A

Value parameters/arguments cannot be changed by the Subprogram, b/c the Subprogram only is given their value.

Reference parameters/arguments CAN be changed by the Subprogram, because the Subprogram is given their address.

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

Define “put on the message board”.

A

Passed by the calling unit

16
Q

Graph?

A

A data structure that consists of a set of nodes with edges that relate the nodes to each other

17
Q

Directed graph?

A

A graph in which each edge is directed from one vertex to to another (or the same) vertex

18
Q

Undirected graph?

A

A graph in which the edges have no direction

19
Q

Another name for an edge in a graph?

A

Arc

20
Q

Lists, stacks, queues, and trees are all just _________?

A

Holding containers

21
Q

Starting point of a binary tree?

A

Root

22
Q

Every node in a binary search tree has ______?

A

One parent