Algorithms and OOD (CSC 207 2014F) : EBoards

# CSC207.01 2014F, Class 27: Quadratic Sorts

Overview

• Preliminaries.
• Upcoming Work.
• Extra Credit.
• Questions.
• Our sorting package.
• Testing sorts.
• Insertion sort.
• Selection sort.

## Preliminaries

• Lab partner is whoever is near you
• Office hours
• Normal this week (MTh 1:45-3:15; walking 1:15-1:45); No hours Friday
• I've added quick walk-in hours today from 2:30-3:30
• I may be hanging out by the Grill during class prep times. Email me to find me.
• I'm hearing reports of potential academic dishonesty in some classes. Please don't let it happen in this class.

### Upcoming Work

• Exam 1 due Thursday.
• Required epilogue due Friday night (or before).

### Extra Credit

• BCC Faculty Chat, Tuesday, October 14, 7pm
• Thursday Extras, 4:30 p.m. Thursday, October 16, Grad School in CS
• CS Table Friday (Day PDR): Debrief from GHC

#### Peer Support

• Ajuna's Radio show Mondays at 8pm. Listen to African music

### Questions

Can I use `double`s to solve the average problem?

Certainly not.

If you think that `double`s make a good approach, try finding the average value in `new long[] { Long.MAX_VALUE - 1 }`, which should be `Long.MAX_VALUE - 1`.

I implemented `average` using BigIntegers. Can I use that implementation in my tests?

Seems excessive.

Hints on the average problem?

Think about what you want to do with things like 2/3 + 2/3 + 8/3.

Think about operations that sometimes go with the division operation.

Does the replacement string have to be the same length as the pattern?

No way, no how.

Can I use `substring` and `subsequence`?

As long as you are aware of their likely costs, which is O(size of created subsequence)