DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005

    Help finishing problem

    I don't how to explain the question that was asked, I think it was something like write a program using arrays that would subtract eash interger in the array? anyway something like this

    array 1/2/5/10/17 then the next array would look like this 2/5/7 then keep subtracting until it reaches zero

    heres what I have so far don't give me the answer but any hints would be helpful thanks

    Int[] seqDiff(int[] a){
    int[] temp= new int[a.length -1];
    for(int i = 0; i<temp.length; i++)
    tmp[i] =a[i+1]-a[i]
    Return temp;
    I don't know how to make it stop

  2. #2
    Join Date
    Sep 2005
    istanbul / Turkey
    1-)all elements of temp array's may reach zero
    (there is no guarantee ).
    you may check it with in a loop. i suggest to write a seperate function doing it . ( forexample boolean isSolved( int[] a) )

    2-or you will have a list which include only 1 element ( non-zero ) so you cant go further.
    this means method is not proper for that data
    or you have not enough points ( data ) to solve it in that way.

    you may search "newton interpolation"
    to learn more abouth this method.

Similar Threads

  1. Problem with Search
    By Irina in forum ASP.NET
    Replies: 0
    Last Post: 11-29-2002, 10:47 PM
  2. Replies: 0
    Last Post: 12-13-2001, 12:06 PM
  3. a problem with font and language
    By Roseta in forum VB Classic
    Replies: 0
    Last Post: 11-14-2001, 03:24 AM
  4. Arabic problem view
    By Ayman in forum VB Classic
    Replies: 0
    Last Post: 04-03-2000, 01:08 AM
  5. Problem with CryptoAPI and JCE
    By Jason Bock in forum VB Classic
    Replies: 0
    Last Post: 03-21-2000, 06:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.