This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; John McCarthy. Puzzle Solving Program in LISP. Memo 20, Artificial Intelligence Project | |
| ; http://www.bitsavers.org/pdf/mit/ai/aim/AIM-020.pdf | |
| ; 1960 | |
| ; Common Lisp translation: Rainer Joswig, 2016, joswig@lisp.de | |
| ; basically the code is unchanged, but using s-expression syntax in Common Lisp | |
| (defparameter pzl | |
| '((a1 (a2 a5) 7.5) | |
| (a2 (a1 a5 a9 a3) 3.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -module(rbtree). | |
| -export([insert/3, find/2]). | |
| % Node structure: { Key, Value, Color, Smaller, Bigger } | |
| find(_, nil) -> | |
| not_found; | |
| find(Key, { Key, Value, _, _, _ }) -> | |
| { found, { Key, Value } }; |