Advertisement
Guest User

Untitled

a guest
Nov 1st, 2018
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.41 KB | None | 0 0
  1. (defun is-palindrome-p (ints)
  2.   "return T iff ints is a palindrome. Use constant space"
  3.   (labels ((aux (xs lower higher)
  4.              (cond ((null xs) nil)
  5.                    ((> lower higher) t)
  6.                    ((not (= (nth lower xs)
  7.                             (nth higher xs)))
  8.                     nil)
  9.                    (t (aux xs (1+ lower) (1- higher))))))
  10.     (aux ints 0 (1- (length ints)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement