Category: Functional Programming

  • Imperative and Functional Insertion Sort in OCaml

    I wrote the insertion algorithm in both imperative and functional styles in OCaml!  I talk about the fun and challenges of each style below: Imperative Insertion Sort I strictly follow the pseudocode on p.18 of the book Introduction to Algorithms.  The pseudocode is in imperative style so all I need to do is to translate…