Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    7
    Views
    1,508

    Re: Linear Search / Index Location of Strings

    The linear method in post #1 is an example of code that searches through the elements in an arrray of objects and returns the index to an element in the array. The code that tests for the match...
  2. Replies
    7
    Views
    1,508

    Re: Linear Search / Index Location of Strings

    The method in post #1 returns the value of the index where the matching Contact object was found.If you called it like this:

    int theIndex = linear(guys, "The name to match");
    Then you could use...
  3. Replies
    7
    Views
    1,508

    Re: Linear Search / Index Location of Strings

    Do you know how to add a method to the Contact class? What do you want to compare or test that is in the Contact object against the value of the variable: target?
    Return true if its a match and...
  4. Replies
    7
    Views
    1,508

    Re: Linear Search / Index Location of Strings

    What you show is NOT an array of Strings. Its an array of Contact class objects.


    The Contact class could have a method that could take an arg(s) and say if that instance of the class matches...
Results 1 to 4 of 4