Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (19 sloc) 725 Bytes
open Core.Std
(** A collection of string frequency counts *)
type t
(** The empty set of frequency counts *)
val empty : t
(** Bump the frequency count for the given string. *)
val touch : t -> string -> t
(* Converts the set of frequency counts to an association list. Every strings
in the list will show up at most once, and the integers will be at least
1. *)
val to_list : t -> (string * int) list
(* part 1 *)
(** Represents the median computed from a set of strings. In the case where
there is an even number of choices, the one before and after the median is
returned. *)
type median = | Before_and_after of string * string
| Median of string
(* part 2 *)
val median : t -> median
You can’t perform that action at this time.