Question
Asked by:
bhuvan
bhuvan from SNHU
Rating : No Rating
Questions Asked: 1
Tutorials Posted: 0
 

$0.25 Algorithems

Q:
Describe an algorithm that takes as input a list of n integer and produce as out put the largest difference obtained by subracting an integer in the list from the one following it.
 
Want to take a stab at the bounty and post a tutorial? Need clarification? Join us now or log in! Read more on how this works.
 
Available Tutorials to this Question
Posted by:
sudipta
sudipta from IIM Bangalore
Rating (488): A
Questions Asked: 0
Tutorials Posted: 3756, earned $12,568.17
 

$4.00 Algorithm for calculating difference

  • This tutorial hasn't been purchased yet.
  • Posted on Nov 01, 2008 at 7:24:21PM
A:
Preview: ... n], the array to store the list of integers

Define loop_integer
Set loop_integer = 1

While (loop_integer – 1 < n)
In ...

The full tutorial is about 72 words long .
Posted by:
modulo51
modulo51 from University of California, Berkeley
Rating (36): B+
Questions Asked: 0
Tutorials Posted: 209, earned $535.69
 

$2.00 Description of algorithm..

  • This tutorial hasn't been purchased yet.
  • Posted on Nov 01, 2008 at 8:57:04PM
A:
Preview: ... and the first index is 0. Thus the index ranges from 0 to n-1.

// initialize
maxDiff = array(1)-array(0);
count = 1;

/ ...

The full tutorial is about 91 words long .
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty