Chapter 8 Flashcards

1
Q

sequential order

A

in order based on alphabet or numbers

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

Ascending/Descending

A

arranging from A-Z or lowest to highest

arranging from Z-A or highest to lowest

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

median value in a list

A

middle item in a list

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

what is ASCII, UNICODE, or EBCDIC

A

coding schemes that translate letters into numbers

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

algorithm

A

list of instructions that accomplish a task

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

bubble sort (sinking sort)

A

items in list are compared with each other in pairs and then swapped based on what is larger or smaller

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

in a bubble sort algorithm(sinking sort) , ascending sorts put the ____ and descending sorts put the ___

A

smallest item on top so the largest item sinks to the bottom

larger item on top so the smallest item sinks to the bottom

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

what does it mean to swap the values of two variables

A

to exchange their values with each other

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

what is the issue with swapping values

A

Ex:

score1 = 90
score 2= 85

If you do score2 = score1, the 85 value is lost. To fix this, create a temporary variable

temp = score2
score2 = score1
score1 = temp

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

what are the general rules of the bubble sort in terms of the number of pair comparisons

A

the number of pair comparisons is one less than the number of elements in the array

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

If you are performing an ascending sort, after you have made on pass through the list, what is guaranteed

A

the largest value is in its correct final position

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

What do you want to do to the comparisons on each pass through the array

A

stop the comparisons one element sooner

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

What is the insertion sort algorithm

A

it looks at each element one at a time, it moves each earlier item down one

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

what is the selection sort algorithm

A

it uses two sublists containing values already sorted and values not yet sorted

it repeatedly looks for the smallest value in the unsorted sublist and swap it with the item at the beginning then add that element to the end of the sorted sublist

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

what does a multidimensional array require

A

more than one subscript

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

a two dimensional array contains ____ and gets the location of any element dependent on _____ factors

A

two dimensions: hNint and width

two

17
Q

each element in a two dimensional array requires two subscripts to reference it?

What are these subscript called

A

row and column

18
Q

to declare a two dimensional array, you

A

type two sets of brackets after array type and name

the first bracket holds the number of rows

the second bracket holds the number of columns

19
Q

in an array subscript for a two dimensional array, what does the first and second subscript represent

A

first represents the row

second represents the column

20
Q

another words for a two-dimensional array is

A

matrix or table