Algorithms and OOD (CSC 207 2014F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [Learning Outcomes] [FAQ] [Teaching & Learning] [Grading] [Rubric] - [Calendar]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Readings]
Reference: [Student-Curated Resources] [Java 8 API] [Java 8 Tutorials] [Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2014S (Rebelsky)] [CSC 207 2014F (Walker)] [CSC 207 2011S (Weinman)]
Misc: [Submit Questions] - [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Overview
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 innew long[] { Long.MAX_VALUE - 1 }, which should beLong.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)