Data Structuers and Functions Flashcards

1
Q

What are the two ways of collecting data items together?

A

Giving collection a name
Accessing the items individually or as a collection

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

What is a named collection of homogeneous items in which individual items are accessed by their place within the collection?

A

Array

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

What is the place within a collection?

A

Index

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

Where do most programming start?

A

They start a 0

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

What is the result of this code?

Integer numbers [10]
//Declares numbers to hold 10 integer values
Write “Enter 10 integer numbers, one per line”
Set Position to 0// set variable positions to 0
WHILE (position < 10)
Read in numbers [position]
Set position to position + 1
//continue with processing

A

Algorithm to put values into the places in an array

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

What is a heterogeneous group of items where individuals items are accessed by name?

A

A record

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

What can a record collection contain?

A

Integers, real values, strings or any other type of data

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

What are records a good choice for?

A

Bundling items together that relate to the same object

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

What looks at each item in turn and compares it to the one for which we are searching. If it matches, we have found the item. If not, we look at the next item?

A

Sequential Search

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

What are special Boolean operations?

A

AND, OR, and NOT

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

What is a binary search?

A

Look for an item in an array using a different strategy

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

What strategies does a binary search use?

A

Divide and conquer!

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

what is a selection sort?

A

It mirrors how we sort a list of values if we had to do it by hand

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

What operator returns true if both expressions are true and false otherwise?

A

AND operator

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

What operator returns false if both expressions are false and true otherwise?

A

OR operator

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

What operator changes the values of the expression?

A

NOT operator

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

What stops looking when we pass the place where it would be if it were present in the array?

A

Sequential search in a Sorted Array

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

What search type can use divide and conquer?

A

Binary search

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

True or False
In a binary search, it starts from the first point and then moves its way down the list, pushing things into the right order.

A

False

A binary seach beings in the middle of the array. If item is less than t

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

What sorts similarly as we would cards in a deck? As it starts the sort, it will move cards in order as it goes through the deck and moves it into the right spot as it gets to the next card.

A

Selection sort

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

What starts at the end of the array, swapping the items whenever the bottom element of the pair in smaller than the one above it?

A

Bubble Sort

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

What algorithm is the easiest to use?

A

Selection Sort

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

What sorts “bubbling up”? Swapping the inserted item into the correct spot?

A

Insert sort

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

What is a container whose properties (data and operations) are specified independently of any particular implementation?

A

Abstract Data type (ADT)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is an implementation of a composite data field in an abstract data type?
Data Structures
26
Whose sole purpose is to hold other objects?
Containers
27
What is an abstract composite structure in which accesses are made at only one end?
Stacks
28
What process is referred to as last in first out (LIFO)?
Stacks
29
What says that the item removed is the item that has been in the stack the shortest time?
Stacks
30
Whose entire behavior is specified through the removal operation?
Last in, first out (LIFO)
31
What is an abstract structure in which items are entered at one end and removed from the other end?
Queues
32
What is First In, First Out (FIFO)?
Queues
33
What occurs as naturally in programming as they do in real life?
Lists
34
What items are homogeneous, the items are linear, and lists have varying lengths.
Lists
35
What does it mean when an item except the first has a unique component that comes before it, and each item except the last has a unique component that comes after it?
Linear
36
What usually provides operations to insert an item?
Lists
37
What operator is used to insert an item in a list?
Insert
38
What operator is used to delete an item from a list?
Delete
39
What operator is used to check whether an item is there?
IsThere
40
What operator reports the number of items in a list?
GetLength
41
What operators have some mechanism for allowing the user to view each item in sequence?
Reset, GetNext, MoreItems
42
What should you not mistake for an array?
Lists
43
What is an implementation of a container where the items are stored together with information on where the next item can be found?
Linked Structure
44
What are actual language constructs?
Subprograms
45
What operator needs a value to insert into it?
Insert
46
What operation needs the list to reset?
Reset
47
What operator needs the list to see if more items remain to be returned?
MoreItems
48
What operator needs the list as input and returns the next item in the list?
GetNext
49
What is a list of identifiers or values with which the subprogram is to work?
Parameter List
50
What appears in parentheses beside the subprogram name?
Parameter
51
What is sometimes called formal parameters?
Parameters
52
What is it when a subprogram is called, the calling unit lists the subprogram name, followed by a list of identifiers in parentheses?
Arguments
53
What represents actual variables in the calling unit with which the subprogram is to work?
Arguments
54
What calling unit gives a copy of the argument to the subprogram?
A Value Parameter
55
What is the calling unit that gives the address of the argument to the subprogram?
A reference parameter
56
Fill in the blank. To access a_________, the subprogram accesses the contents of the address listed on the message board.
Reference Parameter
57
Fill in the blank To access a________, the subprogram accesses the contents of the message board.
A value parameter
58
Fill in the blank When a parameter is a__________, the subprogram knows to manipulate the contents of the address on the message board.
Reference Parameter
59
What does this diagram represent?
The difference between value parameters and reference parameters
60
What is a collection of elements, each containing a reference to the next element?
Linked List
61
What describes a stack?
Last In First out (LIFO)
62
What is the primary characteristic of a queue?
It has FIFO access
63
What is a subprogram?
A sequence of program instructions that perform a specific task
64
In pseudocode, how would you call a function named CalculateSum with two parameters a and b?
1) Execute CalculateSum with a, b 2) Csum = CalculateSum(a, b) 3) CALL CalculateSum a b 4) CalculateSum(a, b)
65
What is the primary purpose of using subprograms in a program?
To allow for code reuse and better organization
66
Which operation is used to add an element to the top of a stack?
Push
67