Commit 6452e0e9 authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

Merge branch 'work' into 'master'

Work

See merge request ec504/hw1/hw1p1!1
parents 478e79c3 25a079c6
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
package edu.bu.ec504.hw1p1;

/**
 * This is a trivial modification!
 */
public class MyDistinctCounter extends DistinctCounter {

  /**
@@ -7,7 +10,6 @@ public class MyDistinctCounter extends DistinctCounter {
   */
  public MyDistinctCounter(int memBits) {
    super(memBits);
    throw new NotYetImplemented();  // replace this with your code!
  }

  /**
@@ -15,7 +17,7 @@ public class MyDistinctCounter extends DistinctCounter {
   */
  @Override
  void saw(String newElement) {
    throw new NotYetImplemented();  // replace this with your code!
    mem.set(Math.abs(newElement.hashCode()%(mem.len)));
  }

  /**
@@ -23,11 +25,10 @@ public class MyDistinctCounter extends DistinctCounter {
   */
  @Override
  Integer numDistinct() {
    throw new NotYetImplemented();  // replace this with your code!
    return mem.bits.cardinality();
  }

  // NESTED CLASSES

  /**
   * A runtime exception indicating that a method has not yet been implemented.
   */