Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CL-USER> (time (let ((top-10 '(0 0 0 0 0 0 0 0 0 0)))
- (map nil (lambda (el)
- (when (> el (first top-10))
- (pop top-10)
- (push el top-10)
- (sort top-10 #'<)))
- '( 12 50954 039 09 4 98 34 88 437 728 73 3 7 37 3 8373827 34 328 1 3 23 3 323 23 3545))
- top-10))
- Evaluation took:
- 0.000 seconds of real time
- 0.000047 seconds of total run time (0.000041 user, 0.000006 system)
- 100.00% CPU
- 127,121 processor cycles
- 0 bytes consed
- (73 88 98 323 328 437 728 3545 50954 8373827)
- CL-USER> (time (let ((top-10 '(0 0 0 0 0 0 0 0 0 0)))
- (map nil (lambda (el)
- (when (> el (first top-10))
- (pop top-10)
- (setf top-10 (merge 'list (list el) top-10 #'<))))
- '(12 50954 039 09 4 98 34 88 437 728 73 3 7 37 3 8373827 34 328 1 3 23 3 323 23 3545))
- top-10))
- Evaluation took:
- 0.000 seconds of real time
- 0.000024 seconds of total run time (0.000021 user, 0.000003 system)
- 100.00% CPU
- 59,641 processor cycles
- 0 bytes consed
- (73 88 98 323 328 437 728 3545 50954 8373827)
- CL-USER> (time (let ((top-10 '(0 0 0 0 0 0 0 0 0 0)))
- (map nil (lambda (el)
- (when (> el (first top-10))
- (setf (first top-10) el)
- (sort top-10 #'<)))
- '(12 50954 039 09 4 98 34 88 437 728 73 3 7 37 3 8373827 34 328 1 3 23 3 323 23 3545))
- top-10))
- Evaluation took:
- 0.000 seconds of real time
- 0.000036 seconds of total run time (0.000031 user, 0.000005 system)
- 100.00% CPU
- 95,138 processor cycles
- 0 bytes consed
- (73 88 98 323 328 437 728 3545 50954 8373827)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement