Problem Solving with Algorithms and Data Structures using (Python|C++|Java)

A triumph of open source and open content

In 2005 I was in my second year of teaching computer science at Luther College. I had enough experience to adamantly oppose Java as our introductory language, and I had learned about Python at the 2004 SIGCSE conference. I was excited about Python and had been playing with it for a year. There was an excellent introductory textbook by John Zelle who was at a nearby college. In our departmental discussions we thought that Python would be a good introductory language, but we didn’t want to give students one semester of Python and then a second semester in Java or C++. We wanted to stick with Python. So I said to my colleague David Ranum, “lets write our own data structures book!” And so we did. We contacted Zelle’s publisher who was very interested in our idea. We wrote the book in 2005 and it was published in 2007. It has been used at several universities as the primary textbook for the data structures course taken by second year computer science majors, as well as a supplementary text for students in other disciplines. The book has been translated into Spanish as well as Chinese.

The goals for the book were: * To have a strong focus on problem solving, that introduces the students to fundamental data structures and algorithms. * To introduce algorithm analysis in terms of Big O notation. * To use Python as the programming language. * To illustrate that we are all “standing on the shoulders of giants.” In computer science we are building on the work of those who came before us.

I loved teaching from this book. The students seemed to enjoy the problems we introduced and learned a lot. By the end of the course they were all much more fluent in Python and ready to tackle other languages and more advanced topics. They all had good “gut level” understanding of the major data structures and algorithms. I was very proud of the book and the course.

I’m also proud that in the 17 years since the first edition was published we have only had two more editions. There is no need to gouge students every two years with a trivial update. The book is still relevant and useful today.

Fast forward to 2011, I was on sabbatical and was working on the second edition of this book. But I had a serious case of “writers block” my main problem was that I just hated the idea of a paper textbook for computer science in the 21st century. Books should be interactive, you should be able to run these algorithms right in the book! That was the genesis of Runestone Academy. The next step was to convince our publisher that we should make the book freely available online. I’ll never forget the response of our publisher, Jim Leisy, “Lets go change the world!” With that, we were able to make the book available under a Creative Commons license. The book is still available in print, but the online version is the one that is being actively maintained, and through our strong partnership with the PreTeXt project we can write once in PreTeXt and publish both online and in print.

The Creative Commons license is a great example of the “shoulders of giants” lesson we wanted to teach our students as in 2018, Jan Pearce of Berea College in Berea Kentucky took our book and created a version for her students that used C++ as the primary programming language! She kept the Python as “pseudocode,” and added C++ examples along side. The content was what she was looking for but the programming language was wrong. So she changed it! She also added some new content and examples. She then shared her changes back with us, and we were able to incorporate the book into our collection. The C++ edition of the book has been used by over 3,000 students in over 223 courses around the world.

In the Fall of 2023 J. David Eisenberg of Evergreen Valley College in San Jose, CA, took the book and created a version for his students that used Java as the primary programming language! The content was what he was looking for but the programming language was wrong. So he changed it! This book does not have Python as pseudocode, but has a lot more interactive exercises and more of the examples can be run in the book than in the Python edition. He also added some new content and examples.

I can’t tell you how proud I am of these two projects. Even though I was personally opposed to Java (and C++) as an introductory language, we don’t all need to agree. And I know I’ll never convince the college board they are wrong. These two books are a great example of the power of open source and open content. I hope that you will consider using this book in your own courses, and if you do, please consider sharing your ideas or changes back with us so that we can all benefit from your work. I would suggest that the Java book is very accessible to high school students who have had the AP Computer Science A course. The Python edition is very accessible to students who have had a semester of programming in any language. If you are willing to help with any of the editions, but especially the Python edition I would love to hear from you. I would really like to make the Python edition much more interactive.