Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "What kind of sort is represented by the passes shown below? (The definition of a pass is non-standard, so be flexible) Pass 153614821628 235681462821 335686281421."— 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) Pass 153614821628 235681462821 335686281421 435662881421 535626881421 635266881421 732566881421 823566881421

2 What kind of sort is represented by the passes shown below? (The definition of a pass is non-standard, so be flexible) Pass 153614821628 235614821628 335614821628 435614821628 535681421628 635681421628 735668142128 823566814218 923566881421

3 What kind of sort is represented by the passes shown below? (The definition of a pass is non-standard, so be flexible) Pass 153614821628 253614886221 353628861421 453628681421 553626881421 653626881421 753266881421 823566881421

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(n 2 ) 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(n 2 ). 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. Define the operator > used by the sort in order to realize this ordering. Class MyClass{ string word; int occurrenceCt; } bool MyClass::operator>(MyClass &other) { return } he 1 it 1 jump 1 she 1 follow 3 bones 5 care 5

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


Download ppt "What kind of sort is represented by the passes shown below? (The definition of a pass is non-standard, so be flexible) Pass 153614821628 235681462821 335686281421."

Similar presentations


Ads by Google