Algebraic and combinatorial Brill-Noether theory