Search:

Type: Posts; User: nicsa

Search: Search took 0.08 seconds.

  1. Replies
    7
    Views
    1,850

    Re: Sorting and Searching: Most Efficient Code

    I don't get what you mean
  2. Replies
    7
    Views
    1,850

    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
  3. Replies
    7
    Views
    1,850

    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;
    }
  4. Replies
    7
    Views
    1,850

    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...
Results 1 to 4 of 4