Pages

Towers of Hanoi Errata

Towers of Hanoi Solutions
  1. In class Moves, method toCSV was:
        public String toCsv()
        {
            String s = "", delimiter = "";
            Iterator i = this.getIterator();
            while (!i.done())
            {
                s += delimiter + i.getNext().toString();
                delimiter = ",";
            }
            return s;
        }
        
    As of 14 January 2018, toCSV is:
        public String toCsv()
        {
            String s = "";
            Iterator i = this.getIterator();
            if (!i.done())
            {
                s = i.getNext().toString();
                while (!i.done())
                    s += "," + i.getNext().toString();
            }
            return s;
        }
        
Towers of Hanoi Exercises
  1. Exercise 2 was: What is the minimum number of moves, mmin, requires...

    As of 19 January 2018 it is: What is the minimum number of moves, mmin, required...