Difference between revisions of "PowersOf2Iterable"
Jump to navigation
Jump to search
Line 9: | Line 9: | ||
interface [https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html Iterator<T>] | interface [https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html Iterator<T>] | ||
+ | |||
+ | <youtube>A-rTJTHq5B4</youtube> | ||
+ | |||
+ | <youtube>PfKnQzbztfo</youtube> | ||
=Mistakes To Avoid= | =Mistakes To Avoid= |
Revision as of 21:47, 21 January 2020
Contents
Motivation
Experience with implementing interfaces.
Warm Up
If you are struggling with this studio, consider completing the Shape warm up.
Investigate
interface Iterable<T>
interface Iterator<T>
Mistakes To Avoid
Warning: Do NOT Parallelize |
Code to Implement
class: | PowersOfTwoLessThan.java | |
methods: | constructor iterator |
|
package: | slices.studio | |
source folder: | student/src/main/java |
constructor
method: public PowersOfTwoLessThan(int maxExclusive)
(sequential implementation only)
iterator
method: public Iterator<Integer> iterator()
(sequential implementation only)
Testing Your Solution
Correctness
class: | PowersOfTwoTestSuite.java | |
package: | powersoftwo.studio | |
source folder: | testing/src/test/java |
Pledge, Acknowledgments, Citations
file: | studio-powers-of-two-iterable-pledge-acknowledgments-citations.txt |
More info about the Honor Pledge