Difference between revisions of "Set Intersector Assignment"

From CSE231 Wiki
Jump to navigation Jump to search
Line 2: Line 2:
 
Performing the set intersection required by the [[Mutual_Friends_MapReduce_Application|Mutual Friends]] exercise can be a bit tricky.  This group warmup will familiarize everyone with the provided [[https://www.cse.wustl.edu/~dennis.cosgrove/courses/cse231/fall22/apidocs/edu/wustl/cse231s/util/SetIntersector.html SetIntersector<E>]] class.
 
Performing the set intersection required by the [[Mutual_Friends_MapReduce_Application|Mutual Friends]] exercise can be a bit tricky.  This group warmup will familiarize everyone with the provided [[https://www.cse.wustl.edu/~dennis.cosgrove/courses/cse231/fall22/apidocs/edu/wustl/cse231s/util/SetIntersector.html SetIntersector<E>]] class.
  
=Code To Investigate=
+
=Code To Use=
 
==SetIntersector<E>==
 
==SetIntersector<E>==
 
class [https://www.cse.wustl.edu/~dennis.cosgrove/courses/cse231/fall22/apidocs/edu/wustl/cse231s/util/SetIntersector.html SetIntersector<E>]
 
class [https://www.cse.wustl.edu/~dennis.cosgrove/courses/cse231/fall22/apidocs/edu/wustl/cse231s/util/SetIntersector.html SetIntersector<E>]

Revision as of 18:38, 11 October 2022

Motivation

Performing the set intersection required by the Mutual Friends exercise can be a bit tricky. This group warmup will familiarize everyone with the provided [SetIntersector<E>] class.

Code To Use

SetIntersector<E>

class SetIntersector<E>

accept(friendIds)
currentIntersection()

Code To Implement

class: Intersections.java Java.png
methods: intersectionOf
package: setintersector.group
source folder: student/src/main/java

method: public static <E> Set<E> intersectionOf(Set<E> first, Set<E>... rest) Sequential.svg (sequential implementation only)

Note: the rest parameter leverages the varargs feature. You may treat this parameter as an array of Set<E>s.

Client

class: IntersectionClient.java DEMO: Java.png
methods: setintersector.client
package:
source folder: src//java

Testing

class: _IntersectionTestSuite.java Junit.png
package: setintersector.group
source folder: testing/src/test/java