6 Feb
2002
6 Feb
'02
9:32 p.m.
Hello. Please, tell me which set of definitions below should I expected to be more efficient: the reverse1 or the reverse2 functions. reverse1 [] ys = ys reverse1 (x:xs) ys = reverse2 (x:ys) xs reverse2 ys [] = ys reverse2 ys (x:xs) = reverse2 (x:ys) xs The difference rely on the position of the argument in which the pattern matching is done in the function definition. Regards. Romildo -- Prof. José Romildo Malaquias Departamento de Computação http://iceb.ufop.br/~romildo Universidade Federal de Ouro Preto romildo@iceb.ufop.br Brasil romildo@uber.com.br