dcsimg

Search:

Type: Posts; User: wqweto

Search: Search took 0.04 seconds.

  1. Thread: quicksort issue

    by wqweto
    Replies
    15
    Views
    1,137

    Re: quicksort issue

    It's the pivot value selection that makes a difference in any particular quick-sort implementation. Currenly you have pivot = data(right) which is vulnerable to pathological inputs (e.g. input...
  2. Thread: quicksort issue

    by wqweto
    Replies
    15
    Views
    1,137

    Re: quicksort issue

    With this input I get 2, 2, 4, 7, 8 in the ListBox and this looks sorted enough IMO.

    What sort of confusion do you find in the snippet above?

    cheers,
    </wqw>
  3. Thread: quicksort issue

    by wqweto
    Replies
    15
    Views
    1,137

    Re: quicksort issue

    I already told you there is no problem in the sorting code now (after ByVal fix) but you are printing elements from final sorted array z in reverse order. Do you understand that?

    You are printing...
  4. Thread: quicksort issue

    by wqweto
    Replies
    15
    Views
    1,137

    Re: quicksort issue

    Parameters left and right should be explicitly passed ByVal in VB6. In VB.Net passing params ByVal is the default, while in VB6 ByRef is default when not specified.

    Change function declaration...
  5. Thread: quicksort issue

    by wqweto
    Replies
    15
    Views
    1,137

    Re: quicksort issue

    Help debugging

    In pivotFun:

    This: data(right) = data(x) should become data(right) = data(left)
    This: data(left) = pivit should become data(left) = Pivot

    Suggestion

    Using...
Results 1 to 5 of 5



Featured


Click Here to Expand Forum to Full Width