DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Chicago
    Posts
    24

    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
    Location
    istanbul / Turkey
    Posts
    133
    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

Bookmarks

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links