MattK
Student of Pure Mathematics and Combinatorics & Optimization at the University of Waterloo
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Gary Daniels and Evan Goldring - Mock whiteboard problem
Aug 26, 2004 at 12:18 PMYou should be able to read more about this in a textbook that covers formal language theory. This includes a lot of textbooks which cover parsing and compilation.
Gary Daniels and Evan Goldring - Mock whiteboard problem
Aug 26, 2004 at 11:57 AMI feel that functional languages haven't been well represented. This is Scheme code:
(define (palindrome? s)
(define (iter s)
(cond ((equal? (length s) 0) #t)
((equal? (length s) 1) #t)
((equal? (car s) (car (reverse s)))
(iter (reverse (cdr (reverse (cdr s))))))
(else #f)))
(iter (string->list s)))
Feel the elegance =)