Month: July 2018

  • More on Imperative Merge Sort

    I talked about how I wrote imperative merge sort in OCaml earlier.  I have been thinking about improving it because it was not as tidy as I’d like.  I learnt a few things in the process: Gain as much information as you can to debug.  E.g., it can help to print out intermediate results.  I…

  • Imperative and Functional Merge Sort in OCaml

    So happy to be back!  The last two week I was running around seeing doctors, lab technicians, etc because I had a mysterious lump on my neck.  It’s still there, but they figured out that it’s nothing worrisome.  I’m so grateful!  I’ve always been healthy so this was really shocking.  I realized that when I’m…

  • Merge Sort and the Divide and Conquer Approach

    Algorithm Design Techniques In earlier posts, I went through the insertion sort and the selection sort algorithms.  They both use the incremental approach.  Each step of the algorithms sorts one element, and thus the algorithms solve the problem incrementally. The divide-and-conquer is another approach.  It includes 3 steps that are executed recursively until the problem…

  • Functional Style Selection Sort in OCaml

    In this post I talk about what I have tried and learnt in the process of writing the functional correspondence of the imperative selection sort I wrote earlier in OCaml.  I learnt a lot in this practice because functional selection sort is not straight forward! The First Attempt At the beginning, I thought functional selection…