Link to home
Start Free TrialLog in
Avatar of scottmolitor
scottmolitor

asked on

Write code to find the greatest element of a list

Write code to find the greatest element of a list
  which could be arbitrarily nested.
For example, given ((3) (((((6 7 7 8))))) 9 10 (88)),
the program should output 88.

USING LISP
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Hi scottmolitor,

What do you consider the "greatest element"?  88 is, based on integer value.  (6 7 7 8) is, based on several set criteria.


Kent
ASKER CERTIFIED SOLUTION
Avatar of skyper3
skyper3

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi skyper3,

Do they even teach LISP coding anymore?  I thought that the language had died.



Kent
Avatar of skyper3
skyper3

Lisp is still _the_ functional language to be teached, if any. At least, here in germany ;)
And it is quite alive, think of emacs and the various dialects (guile, scheme, and as unification of several other dialects: common-lisp)
Hi skyper3,

Germany is like an entirely different planet, compared to the U.S.  I've got a LISP compiler running on an old CYBER emulator, but that's as close to LISP as I've been in quite a while...

Then again, do you remember SNOBOL?   :)


Kent
SNOBOL? ;)
Hehe, never ran across this, but the wikipedia-article promises an interesting language ;)
Remarkable is the reference to SPITBOL, the Speedy Implementation Of Snobol  (muhaha ;))
Politics?

12 is a good number for a jury
  1 is a good number for a leader
** (very large) is number for money required to get something done, millions, billions, whatever is at least as big as another if not bigger

> Then again, do you remember SNOBOL

Actually, memory tells me it sounds like Cobol, but "SN" meant 'string'

    the greatest element of a list
    the program should output 88.

Actually, that is also true in a math, where figure 8 represents infinity. Can't get much bigger than infinity, unless maybe concatenated with infinity?