Solutions to problems listed in http://aperiodic.net/phil/scala/s-99/
P01: Find the last element of a list. (Done)
P02: Find the last but one element of a list. (Done)
P03: Find the Kth element of a list. (Done)
P04: Find the number of elements of a list. (Done, Both recursion and tail recursion)
P05: Reverse a list. (Done, Both recursion and tail recursion)
P06: Find out whether a list is a palindrome. (Done)
P07: Flatten a nested list structure. (Done)
P08: Eliminate consecutive duplicates of list elements. (Done)
P09:
P10:
P11:
P12:
P13:
P14: Duplicate the elements of a list. (Done)
P15: Duplicate the elements of a list a given number of times. (Done)
P16:
P17:
P18:
P19:
P20:
P21:
P22:
P23:
P24:
P25:
P26:
P27:
P28:
P29:
P30:
P31: Determine whether a given integer number is prime. (Done)
P32: Determine the greatest common divisor of two positive interger numbers. (Done, tail recursion)
P33:
P34:
P35:
P36:
P37:
P38:
P39:
P40:
P41:
P42:
P43:
P44:
P45:
P46: Truth tables for logical expressions. (Done)
P47: Truth tables for logical expressions(2). (not Done)
P49: Gray code. (Done, not optimized yet)
P50:
P55:
P56:
P57:
P58:
P59:
P60:
P61:
P61A:
P62:
P62B:
P63:
P64:
P65:
P66:
P67:
P68:
P69:
P70:
P70C:
P71:
P72:
P73:
P74:
P75:
P76:
P77:
P78:
P79:
P80:
P81:
P82:
P83:
P84:
P85:
P86:
P87:
P89:
P90:
P91:
P92:
P93:
P94:
P95:
P95:
P96:
P97:
P98:
P99: