Tag archives for code

  1. Swapping Values of Two Integer Variables

    The simplest way to swap the values of two variables is to have a third variable that can temporarily hold the value of one variable while the other is being copied. This is very easy code, but a small problem is that we have to allocate extra memory. In these days of gigabytes of data,…

  2. Implementation of Kruskal’s algorithm in Java

    I will be posting some code from time to time. Some of these posts are from way back. I could probably rewrite them if I wanted to and perhaps in a different language, but there are bigger fish to fry. But maybe someone may find this useful. So this is the Kruskal’s algorithm which finds…