I'm new to scheme , can someone please give me ideas on how to get , "the middle element from a list?"
相关问题
- Generating powerset in one function, no explicit r
- What is fixed point?
- unfold function in scheme
- returns the first n of list
- How to use (read) correctly in mit-scheme?
相关文章
- Does learning one Lisp help in learning the other?
- What is the definition of “natural recursion”?
- How do I define a sub environment in scheme?
- Why is it legal in a function definition to make s
- How to split list into evenly sized chunks in Rack
- Difference between OOP and Functional Programming
- Good simple algorithm for generating necklaces in
- Why is there no tail recursion optimization in Ema
Here's my solution. It's based on a tortoise-and-hare algorithm (which is used in any kind of list traversal where you need to detect circular lists), so it doesn't do any more work than a sane list traversal has to do anyway. :-)
It covers the following cases:
#f
.