Algorithms and OOD (CSC 207 2014F) : EBoards

CSC207.01 2014F, Class 27: Quadratic Sorts


Overview

Preliminaries

Admin

Upcoming Work

Extra Credit

Academic

Peer Support

Questions

Can I use doubles to solve the average problem?

Certainly not.

If you think that doubles 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)

Lab