Re: Tasks

new topic     » goto parent     » topic index » view thread      » older message » newer message

ooooOOOOO
good stuff jiri
i was thinking find(1,{somerecursivemumbojumbo}) might save our arse here
sumfin like splitting the sequence into successive halves, using carl's
oneliner in the center of that to process the successive halves, making
each value get set to 0 if it was under another value in recursive
succession
and using find(1,result) to pull out that very last true to show us the
location/index of the highest/lowest singular value remaining....
yer's is really close to that premise by rotating thru pairs of next door
neighbor values and continously repicking the highest/lowest from those
kissing cousins....
kind of a bubble sort thing going there...
well done :)

we are close ;)


----- Original Message -----
From: Jiri Babor <J.Babor at GNS.CRI.NZ>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Monday, August 14, 2000 4:14 PM
Subject: Re: Tasks


> Good morning, Hawke'.
>
> I cannot do them as one-liners, but using your (Carl's?) suggestion, two
> statements suffice.
> The code below is not terribly efficient and is applicable to
one-dimensional
> sequences only.
>
> jiri
>
> --  minmax.ex
> --  jiri_babor at hotmail.com
> --  00-08-15
>
> function min(sequence s)
>     while length(s)>1 do
> end while
>     return s[1]
> end function
>
> function max(sequence s)
>     while length(s)>1 do
> end while
>     return s[1]
> end function
>
> -- test --------------------------------------------------------------
> ? min({4.1, -77.2, 111, 15.3})
> ? max({4.1, -77.2, 111, 15.3})
>

_______________________________________________
Why pay for something you could get for free?
NetZero provides FREE Internet Access and Email
http://www.netzero.net/download/index.html

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu