Week 3 Flashcards

1
Q

What is Data?

A

Independent fact, observation or value.

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

What is a record?

A

The data pertaining to a unique object. .

Sometimes called an element. Consists of one or more fields. Can be thought of as rows in tables.

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

What is a field?

A

A field is a constituent part of a record, usually consisting of a single data element.

It has a specified type and size.

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

What is a file?

A

A collection of records

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

What is a key?

A

The data field used to select or order records.

May or may not be unique.

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

What is a primary key?

A

The field used first for selecting or sorting records.

eg. Last names in a telephone book

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

What is a Secondary Key?

A

The field used if 2 or more records have equal primary keys.

eg. first names in a telephone book

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

What is searching? What is sorting?

A

Searching: An operation that returns a pointer to a record that matches a key value.

Sorting: arranges items of a list into ascending or descending order.

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

What are the two classification of search algorithms.

A

Sequential and interval

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

How does a linear search work? What is the complexity of a linear search.

A

A linear search algorithm starts at the beginning of a list, then compares each successive item to a query key until we find a match or reach the end of the list.

The complexity is O(n) or better for small sets of data in some cases.

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

What is the best case complexity of a linear search?

A

The best case is O(1). Or constant

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

We know that the average case complexity for a linear search is O(n). We also know that the worst case complexity is O(n). Does this mean that they take the same time?

A

No this doesn’t mean that they take the same time. What this tells us is that they are both linear.

This analysis is not based on time.

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

What are the three design techniques for divide and conquer?

A

Divide the problem into a number of subproblems that are smaller instances of the same problem.

Conquer the subproblems by solving them recursively.

Combine the solutions to the subproblems into the solution for the original.

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

What is recursion?

A

Recursion is a programming construct where a function calls itself during execution.

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