Created
January 10, 2017 20:51
-
-
Save boldijar/6a910ac3fc2982032f5ac7f8f4daf30b to your computer and use it in GitHub Desktop.
This file contains 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
(defun preordine(l) | |
(cond | |
( ( null l ) nil ) | |
( t | |
( | |
append | |
( list ( car l ) ) | |
( preordine ( cadr l ) ) | |
( preordine ( caddr l )) | |
) | |
) | |
) | |
) | |
(defun postordine(l) | |
(cond | |
( ( null l ) nil ) | |
( t | |
( | |
append | |
( postordine ( cadr l ) ) | |
( postordine ( caddr l )) | |
( list ( car l ) ) | |
) | |
) | |
) | |
) | |
(defun inordine(l) | |
(cond | |
( ( null l ) nil ) | |
( t | |
( | |
append | |
( inordine ( cadr l ) ) | |
( list ( car l ) ) | |
( inordine ( caddr l )) | |
) | |
) | |
) | |
) | |
;adancimea unui arbore | |
(defun adancime(l) | |
( cond | |
( ( null ( cdr l ) ) 0 ) | |
( t ( + 1 | |
( max ( adancime ( cadr l ) ) ( adancime ( caddr l ) ) ) | |
) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment