Package flashcards

Class BucketRange

java.lang.Object
flashcards.BucketRange

public class BucketRange
extends Object
Find which buckets contain flashcards, as a rough measure of progress.
  • Method Details

    • getBucketRange

      public static List<Integer> getBucketRange​(List<Set<Flashcard>> buckets)
      Find a minimal range of bucket numbers covering a list of learning buckets.
      Parameters:
      buckets - a list of disjoint sets representing learning buckets, where buckets.get(i) is the set of cards in the ith bucket, for all i that are valid indexes of the list.
      Returns:
      a pair of integers [low, high], 0 <= low <= high, such that every card in buckets has a bucket number in the range [low...high] inclusive, and high - low is as small as possible