This should be fairly easy, and fun and challenging enough to flex them 
neurons.

I was working in a deficient language today and needed something to 
create a comma separated string from a list. I.e. given (one two three 
four) => "one, two, three, four"

So, no the language's built-in collection classes did not support a join 
method (opposite of 'split'). Note, not true for Ruby and Perl.

Choose any language for implementation. (Perl, Ruby, Lisp, even Bash or 
compiled languages like C#, Java or C++) Even Pseudo-Code works. Just 
need the algorithm.

Hints:
    Recursion and tail (rest) of the list could (but don't have to) play 
a part. For Ruby, implement tail as list[1..-1]
    Implementing tail in some languages can be hard. If a language has a 
Stack type, and a reverse you can simulate it with pop(). Look for a 
Queue type (FIFO) instead.

Have fun.

-- 
Ed Howland
WDT Solutions, LLC.
[EMAIL PROTECTED]
(314) 962-0766

 
_______________________________________________
CWE-LUG mailing list
[email protected]
http://www.cwelug.org/
http://www.cwelug.org/archives/
http://www.cwelug.org/mailinglist/

Reply via email to