Count occurrence of element in a list in Scheme?
Your question wasn’t very specific about what’s being counted. I will presume you want to create some sort of frequency table of the elements. There are several ways to go about this. (If you’re using Racket, scroll down to the bottom for my preferred solution.) Portable, pure-functional, but verbose and slow This approach uses an … Read more