Search:

Type: Posts; User: Mr.777

Search: Search took 0.09 seconds.

  1. Replies
    7
    Views
    1,398

    Re: Binary Search Help

    Why are you doing this?

    int beg=data[0];// wrong actually you are assigning value here but you should assign index.
    //So do,
    int beg=0;
    int end=data.length()-1;
  2. Replies
    7
    Views
    1,398

    Re: Binary Search Help

    mid=(end+beg)/2
    not mid=(end-beg)/2;
  3. Replies
    7
    Views
    1,398

    Re: Binary Search Help

    1. Post your code in code tags.
    2. Try learning indentation from here.
    3. You are assigning the values to the variables beg, end, data values of array, not actually the index of array.
    4. You...
Results 1 to 3 of 3