Any book on algorithms will ultimately become either a fanfare of overwhelming math & code examples or a pedantic display. It is the goal of this author to avoid both. Mathematical jargon will be kept to a minimum. Focus will be placed exclusively on the understanding of the principles of the algorithm. It does not matter that some algorithms are sufficiently out of date as to fashion only honorable mention. It is the opinion of this author that the history is the quintessential delivery mechanism for understanding traditional computing algorithms and therefore the deeper meaning of how things have come to be.
Many problems today still require this base knowledge. Many times this knowledge is only glossed over in favor of libraries that perform the task satisfactorily. However, understanding the mechanisms at play will give the learner the knowledge necessary to understand when a library routine is insufficient or inefficient to be selected. The learner is then well prepared to undertake building a more suitable replacement for they now possess the knowledge of history and we all know the outcome of not knowing one’s history.
Make no mistake, there will be a considerable amount of code within this text. It is the intention to provide many examples in at least two languages throughout. The languages of choice are Java and C. These choices are made for a myriad of reasons.
Java, because it is heavily in use today in a variety of places including web-based solutions. Anyone who does not believve this is the case can simply look at Apereo CAS, Thymeleaf, Spring Boot and many others.
C, because it is the root language from which so many other languages have sprung. And, it is the core language of Linux, Samba and many other products that need close proximity to the CPU.
The book is organized into a few specific sections. Before beginning, however, it is highly recommended that you brush up on recursion as many of the solutions are based in recursion. This is especially true when an iterative solution cannot be found.
- Sorting
- Basics (Bubble, Selection, Insert)
- Practical (Merge, Quick)
- Searching
- Basics (Linear, Binary)
- Practical (Hash Tables)
- Lists
- Basics
- Stacks
- Queues
This textbook follows a few basic teaching paradigms which are as follows:
Constructivism – the premise that learning occurs through the physical building (construction) of solutions. Therefore, this is a project-based approach, where appropriate.
Situated learning – the premise that learning best occurs in the environment as close as possible to the one in which learners will eventually be employed. Therefore the selection of an integrated development environment (IDE) should be enhanced by exercising the pre-training principle of the Cognitive Theory of Multimedia Learning (Clark & Mayer, 2011). Whether traditional, hybrid or online, learners must be shown how to use the tools without taking up precious classroom time. Consider developing pre-training videos, further applying the segmentation principle, with formative assessments. This combined with a form of adaptive release in a Learning Management System (LMS) can go a long way
Metacognition – learners must be aware of their own cognition and must be encouraged to reflect on their accomplishments and setbacks equally. Consider implementing a reflective journal which allows learners to write about their experiences. In future journal entries, they may reflect on previous entries to assess whether there position has changed.
Rigor is intended throughout. Academic rigor is not about piling on project after project until the learner relents or terrifying undergraduate learners with graduate content. Rather it is about challenging them in new ways. It is about taking what they have learned and push it to new limits, applying it in new and interesting ways. When introducing the topics of this book, instructors should be thinking about how these concepts can be reintroduced in new ways to challenge learners when combined with future concepts.
There are also a few other general tenets. They are as follows:
Segmentation Principle – From the Cognitive Theory of Multimedia Learning, where appropriate, there is adherence to the segmentation principle. Breaking problems down into more digestible pieces is just as important in an application of problem solving as it is to a video clip. Learners need to understand why the problem is broken down a particular way.
Show, Don’t Tell – Many textbooks waste the learner’s time with needless narrative asides, extraneous tips, vague negations and passing anecdotal notations. You will not find those here. If something is worth noting, it will be accompanied by full coding examples with details of the why or why not something is done a particular way.
Your time is precious – As with Show, Don’t Tell, your time will not be needlessly wasted. A conversational yet minimalist approach is applied to each section. Getting to the heart of the matter is the most important aspect of learning. Learners and educators alike are encouraged to utilize the many examples as provided but then adapt them in new ways to solve new problems.