Login   /   Register

Worst Case Array Statistics

Rate this article
     0 votes, average: 0 out of 50 votes, average: 0 out of 50 votes, average: 0 out of 50 votes, average: 0 out of 50 votes, average: 0 out of 5
Loading ... Loading ...
April 2nd, 2008 by daniva

Worst case means that the array is already sorted in reverse order from the required. Worst Case Function just loop from max to min to create a sorted array in descending order

image

Worst Case Function

Public Sub WorstCase( ByRef arr(), Byval nSize )
    Dim i, nCount
    Redim arr( nSize - 1 )
    nCount = 0
    For i = UBound( arr ) To LBound( arr ) Step - 1
        arr( nCount ) = i + 1
        nCount = nCount + 1
    Next
End Sub

Posted in Arrays

2 Responses to “Worst Case Array Statistics”

  1. Balaji_singaram Says:

    [-]

    This is waste

  2. Balaji_singaram Says:

    [-]

    Sorry for the previous comment great work

Leave a Reply

You must be logged in to post a comment.

This article was viewed 480 times