Minimum Swaps 2

Once again it is Friday. Time seems to be flying by. The temperature in the Twin Cities of Minneapolis and St. Paul continues to drop. The day light continues to get shorter and shorter. That said; my wife and I are now walking after work. Yesterday afternoon at 05:00 PM CDT was 72F and the day was sunny. Hopefully we will have a few more weeks with similar days. Winter is coming.

No special plans for the weekend. During breakfast this morning my wife and I were discussing if we will grill beef steaks or make pork ribs. I believe we have both in the garage freezer. I am inclined to grilling due to the fact that nice days for grilling outside are coming to an end. We can prepare ribs in the oven in the mid of winter and they taste great.

This morning while browsing LinkedIn I noticed that my son’s best friend has been assigned as Director of Engineering at Apple. Congratulations on your career achievement! Continue reading “Minimum Swaps 2”

Selection Sort

selection_sortContinue to read and experiment with most of the exercises in the Algorithms fourth edition book by Robert Sedgewick and Kevin Wayne. I am currently reading chapter 2.1 Elementary Sorts. I just finished the section that deals with Selection sort. The subject matter is well described and a set of methods (with possible some exceptions) will be used to implement all the sorting algorithms in this chapter. That is quite nice because it emphasizes on the concept of hiding data and the actual algorithm from clients.

The following methods are common to all sorting algorithms described in the second chapter: Continue reading “Selection Sort”