Search:

Type: Posts; User: nicsa

Search: Search took 0.23 seconds.

  1. Replies
    6
    Views
    5,005

    Removing Duplicate Values From an Array

    I am to remove all duplicates form an array.

    For example:
    4 7 11 4 9 5 11 7 3 5
    should be changed to
    4 7 11 9 4 3

    I am not supposed to use hashtables. Is there a simple way to do this. I...
  2. Replies
    7
    Views
    1,833

    Re: Sorting and Searching: Most Efficient Code

    I don't get what you mean
  3. Replies
    7
    Views
    1,833

    Re: Sorting and Searching: Most Efficient Code

    public int sortedSearch(int value)
    {
    int x=0;
    while(x<a.length)
    {
    if(a[x]==value)
    {
    return x;
    }
    else
  4. Replies
    7
    Views
    1,833

    Re: Sorting and Searching: Most Efficient Code

    public int sortedSearch(int value)
    {
    for(int x=0;x<a.length; x++)
    {
    if(a[x]==value)
    return x;
    }
    return -1;
    }
  5. Replies
    7
    Views
    1,833

    Sorting and Searching: Most Efficient Code

    I am trying to create a method to search a sorted array for a value in the most efficient way possible. My teacher doesn't want us to use binary search yet. This is the code I have so far, is there...
  6. HELP, I AM HAVING A PROBLEM WITH ADDING VALUES OF AN ARRAY TO A STRING

    Hi, I seem to be having a consistent error when I try to add the values of an array I created to a String. I keep getting a NullPointerException Error. I went through and checked to make sure that...
  7. Replies
    6
    Views
    2,180

    Re: NullPointerException Error

    It was my toString, that was dumb of me.
  8. Replies
    6
    Views
    2,180

    Re: NullPointerException Error

    I am adding the values in the salespersonTotal method.
  9. Replies
    6
    Views
    2,180

    Re: NullPointerException Error

    This is what I get when I print out the values:

    System.out.println(productTotal[0]);
    System.out.println(productTotal[1]);
    System.out.println(productTotal[2]);...
  10. Replies
    6
    Views
    2,180

    NullPointerException Error

    Hi, I am new to programming. I have an assignment where I am to create a class that processes a sales slip that contains a salesperson number, product number, and the total dollar value of that...
Results 1 to 10 of 10