1 / 6

# Which is better?

What kind of sort is represented by the passes shown below? (The definition of a pass is non-standard, so be flexible). What kind of sort is represented by the passes shown below? (The definition of a pass is non-standard, so be flexible).

Télécharger la présentation

## Which is better?

E N D

### Presentation Transcript

1. What kind of sort is represented by the passes shown below? (The definition of a pass is non-standard, so be flexible)

2. What kind of sort is represented by the passes shown below? (The definition of a pass is non-standard, so be flexible)

3. What kind of sort is represented by the passes shown below? (The definition of a pass is non-standard, so be flexible)

4. Which is better? • I have an O(n) algorithm. Is it faster to solve one problem with all n items or k problems each with n/k items? Example: canning peaches is O(n). Would I be happier dividing the work into two chunks. • I have an O(n2) algorithm. Is it faster to solve one problem with all n items or k problems each with n/k items? Example: finding out which of your friends know each other is O(n2). Would it be easier to determine which of the guys know each other and which of the gals know each other?

5. Suppose I wanted to sort a file by occurrenceCt and within ocurrenceCt, alphabetically. he 1 it 1 jump 1 she 1 follow 3 bones 5 care 5 Define the operator > used by the sort in order to realize this ordering. Class MyClass{ string word; intoccurrenceCt; } boolMyClass::operator>(MyClass &other) { return }

6. What kind of sort is represented by the passes shown below? (The definition of a pass is non-standard, so be flexible)

More Related