background preloader

LiteratePrograms:Welcome

LiteratePrograms:Welcome
Warning: LiteratePrograms is currently undergoing a license migration to Creative Commons CC0 1.0. All content will be erased unless its authors agree to release it under CC0. If you wish for your contributed content to be retained, please add a statement to your user page that you release all your contributions under CC0 1.0, and inform me via Special:Emailuser/Dcoetzee. You can also re-add content that you created after the migration, provided that you are the sole author. Based on Donald Knuth's concept of literate programming, LiteratePrograms is a collection of code samples displayed in an easy-to-read way, collaboratively edited and debugged, and all released into the public domain under the Creative Commons CC0 1.0 waiver (see Copyrights) so that anyone can use our code and text for any purpose without restriction. Code on LiteratePrograms is organized in a variety of ways using categories: by subject area, by language, by environment, and so on. List of all articles

Sorting Algorithm Animations Algorithms in Java, Parts 1-4, 3rd edition by Robert Sedgewick. Addison Wesley, 2003. Quicksort is Optimal by Robert Sedgewick and Jon Bentley, Knuthfest, Stanford University, January, 2002. Dual Pivot Quicksort: Code by Discussion. Bubble-sort with Hungarian (“Csángó”) folk dance YouTube video, created at Sapientia University, Tirgu Mures (Marosvásárhely), Romania. Select-sort with Gypsy folk dance YouTube video, created at Sapientia University, Tirgu Mures (Marosvásárhely), Romania. Sorting Out Sorting, Ronald M. A* Pathfinding for Beginners By Patrick Lester (Updated July 18, 2005) This article has been translated into Albanian, Chinese, Finnish, German, Greek, Korean, Polish, Portuguese, Romanian, Russian, Serbian, and Spanish. Other translations are welcome. The A* (pronounced A-star) algorithm can be complicated for beginners. This article does not try to be the definitive work on the subject. Finally, this article is not program-specific. But we are getting ahead of ourselves. Introduction: The Search Area Let’s assume that we have someone who wants to get from point A to point B. [Figure 1] The first thing you should notice is that we have divided our search area into a square grid. These center points are called “nodes”. Starting the Search Once we have simplified our search area into a manageable number of nodes, as we have done with the grid layout above, the next step is to conduct a search to find the shortest path. We begin the search by doing the following: [Figure 2] Path Scoring where [Figure 3] [Figure 4] [Figure 5]

Sorting and Searching Strings Ternary Search Trees Jon Bentley and Robert Sedgewick feature article in Dr. Dobbs Journal April, 1998 Abstract When you have to store a set of strings, what data structure do you use? Fast Algorithms for Sorting and Searching Strings presented at Eighth Annual ACM-SIAM Symposium on Discrete Algorithms New Orleans, January, 1997 We present theoretical algorithms for sorting and searching multidimensional data and practical C implementations for the application where keys are character strings. Comments, questions, suggestions: mail rs@cs.princeton.edu mail jlb@research.bell-labs.com

Related: