maximal difference problem

Discuss all kind of algorithms and data structures from their mathematical and programming sides.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

maximal difference problem

Postby alnet » Sat Feb 26, 2005 8:45 am

You are given n real (unsorted) numbers. You have to compute the maximal difference between two consecutive numbers in sorted order without sorting the numbers. You can use additions, subtractions, multiplications, divisions and "floor" function.
alnet
 
Posts: 2
Joined: Sat Feb 26, 2005 8:44 am

Postby t i l e x » Sat Feb 26, 2005 9:00 am

Seems like a homework to me. Prove use that you have at least tried.
User avatar
t i l e x
 
Posts: 3604
Joined: Wed Dec 03, 2003 3:59 pm
Location: Québec (Canada)

Postby alnet » Sat Feb 26, 2005 9:03 am

It's a homework. It was given in our course and I have a solution for it.
alnet
 
Posts: 2
Joined: Sat Feb 26, 2005 8:44 am

Postby t i l e x » Sat Feb 26, 2005 9:10 am

Show some code you have written so far and I will try to help you then.
PS: Is there a question except than "code it for me" ?.
User avatar
t i l e x
 
Posts: 3604
Joined: Wed Dec 03, 2003 3:59 pm
Location: Québec (Canada)

Postby DannyBoy » Sat Feb 26, 2005 10:24 am

alnet wrote:It's a homework. It was given in our course and I have a solution for it.
If you have a solution to it, then why are you posting it? :roll:
User avatar
DannyBoy
 
Posts: 1160
Joined: Fri Feb 13, 2004 12:56 pm
Location: In the Billiard Room with the Lead Pipe

Postby leas5040 » Sat Feb 26, 2005 2:37 pm

Perhaps he is testing us?
"Given enough time, man can do anything with a bit of string and some Tinker toys." Bruce Bolden, Senior Instructor at the University of Idaho.
User avatar
leas5040
 
Posts: 1214
Joined: Mon Apr 12, 2004 9:51 pm
Location: Moscow, ID


Return to Algorithms & Data Structures

Who is online

Users browsing this forum: No registered users and 1 guest