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
Q

What is an implementation of a composite data field in an abstract data type?

A

Data Structures

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

Whose sole purpose is to hold other objects?

A

Containers

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

What is an abstract composite structure in which accesses are made at only one end?

28
Q

What process is referred to as last in first out (LIFO)?

29
Q

What says that the item removed is the item that has been in the stack the shortest time?

30
Q

Whose entire behavior is specified through the removal operation?

A

Last in, first out (LIFO)

31
Q

What is an abstract structure in which items are entered at one end and removed from the other end?

32
Q

What is First In, First Out (FIFO)?

33
Q

What occurs as naturally in programming as they do in real life?

34
Q

What items are homogeneous, the items are linear, and lists have varying lengths.

35
Q

What does it mean when an item except the first has a unique component that comes before it, andeach item except the last has a unique component that comes after it?

36
Q

What usually provides operations to insert an item?

37
Q

What operator is used to insert an item in a list?

38
Q

What operator is used to delete an item from a list?

39
Q

What operator is used to check whether an item is there?

40
Q

What operator reports the number of items in a list?

41
Q

What operators have some mechanism for allowing the user to view each item in sequence?

A

Reset, GetNext, MoreItems

42
Q

What should you not mistake for an array?

43
Q

What is an implementation of a container where the items are stored together with information on where the next item can be found?

A

Linked Structure

44
Q

What are actual language constructs?

A

Subprograms

45
Q

What operator needs a value to insert into it?

46
Q

What operation needs the list to reset?

47
Q

What operator needs the list to see if more items remain to be returned?

48
Q

What operator needs the list as input and returns the next item in the list?

49
Q

What is a list of identifiers or values with which the subprogram is to work?

A

Parameter List

50
Q

What appears in parentheses beside the subprogram name?

51
Q

What is sometimes called formal parameters?

A

Parameters

52
Q

What is it when a subprogram is called, the calling unit lists the subprogram name, followed by a list of identifiers in parentheses?

53
Q

What represents actual variables in the calling unit with which the subprogram is to work?

54
Q

What calling unit gives a copy of the argument to the subprogram?

A

A Value Parameter

55
Q

What is the calling unit that gives the address of the argument to the subprogram?

A

A reference parameter

56
Q

Fill in the blank.

To access a_________, the subprogram accesses the contents of the address listed on the message board.

A

Reference Parameter

57
Q

Fill in the blank

To access a________, the subprogram accesses the contents of the message board.

A

A value parameter

58
Q

Fill in the blank

When a parameter is a__________, the subprogram knows to manipulate the contents of the address on the message board.

A

Reference Parameter

59
Q

What does this diagram represent?

A

The difference between value parameters and reference parameters

60
Q

What is a collection of elements, each containing a reference to the next element?

A

Linked List

61
Q

What describes a stack?

A

Last In First out (LIFO)

62
Q

What is the primary characteristic of a queue?

A

It has FIFO access

63
Q

What is a subprogram?

A

A sequence of program instructions that perform a specific task

64
Q

In pseudocode, how would you call a function named CalculateSum with two parameters a and b?

A

1) Execute CalculateSum with a, b
2) Csum = CalculateSum(a, b)
3) CALL CalculateSum a b
4) CalculateSum(a, b)

65
Q

What is the primary purpose of using subprograms in a program?

A

To allow for code reuse and better organization

66
Q

Which operation is used to add an element to the top of a stack?