Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define-struct email (remitente destinatario mensaje))
- (define l (list
- (make-email "pedro" "maria" "hola xD")
- (make-email "carlos" "juan" "¿como anda?")
- (make-email "ana" "juana" "te odio :)")
- )
- )
- (define (intro n lst)
- (cond
- [(empty? lst) (list n)]
- [else
- (cond
- [(string<? (email-remitente n) (email-remitente (first lst))) (cons n lst)]
- [else (cons (first lst) (intro n (rest lst)))]
- )
- ]
- )
- )
- (define (ordenar lst)
- (cond
- [(empty? lst) empty]
- [else
- (intro (first lst) (ordenar (rest lst)))
- ]
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement