亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sort.bas

?? Visual.Basic.NET實用編程百例-47.6M.zip
?? BAS
字號:
Attribute VB_Name = "Module1"
Option Explicit
Global Const ZERO = 0
Global Const ASCENDING_ORDER = 0
Global Const DESCENDING_ORDER = 1

Global gIterations

Sub BubbleSort(MyArray(), ByVal nOrder As Integer)
Dim Index
Dim TEMP
Dim NextElement

    NextElement = ZERO
    Do While (NextElement < UBound(MyArray))
        Index = UBound(MyArray)
        Do While (Index > NextElement)
            If nOrder = ASCENDING_ORDER Then
                If MyArray(Index) < MyArray(Index - 1) Then
                    TEMP = MyArray(Index)
                    MyArray(Index) = MyArray(Index - 1)
                    MyArray(Index - 1) = TEMP
                End If
            ElseIf nOrder = DESCENDING_ORDER Then
                If MyArray(Index) >= MyArray(Index - 1) Then
                    TEMP = MyArray(Index)
                    MyArray(Index) = MyArray(Index - 1)
                    MyArray(Index - 1) = TEMP
                End If
            End If
            Index = Index - 1
            gIterations = gIterations + 1
        Loop
        NextElement = NextElement + 1
        gIterations = gIterations + 1
    Loop

End Sub

Sub Bucket(MyArray(), ByVal nOrder As Integer)
Dim Index
Dim NextElement
Dim TheBucket

    NextElement = LBound(MyArray) + 1
    While (NextElement <= UBound(MyArray))
        TheBucket = MyArray(NextElement)
        Index = NextElement
        Do
            If Index > LBound(MyArray) Then
                If nOrder = ASCENDING_ORDER Then
                    If TheBucket < MyArray(Index - 1) Then
                        MyArray(Index) = MyArray(Index - 1)
                        Index = Index - 1
                    Else
                        Exit Do
                    End If
                ElseIf nOrder = DESCENDING_ORDER Then
                    If TheBucket >= MyArray(Index - 1) Then
                        MyArray(Index) = MyArray(Index - 1)
                        Index = Index - 1
                    Else
                        Exit Do
                    End If
                End If
            Else
                Exit Do
            End If
            gIterations = gIterations + 1
        Loop
        MyArray(Index) = TheBucket
        NextElement = NextElement + 1
        gIterations = gIterations + 1
    Wend

End Sub

Sub Heap(MyArray())
Dim Index
Dim Size
Dim TEMP

    Size = UBound(MyArray)
    
    Index = 1
    While (Index <= Size)
        Call HeapSiftup(MyArray(), Index)
        Index = Index + 1
        gIterations = gIterations + 1
    Wend

    Index = Size
    While (Index > 0)
        TEMP = MyArray(0)
        MyArray(0) = MyArray(Index)
        MyArray(Index) = TEMP
        Call HeapSiftdown(MyArray(), Index - 1)
        Index = Index - 1
        gIterations = gIterations + 1
    Wend

End Sub
 

Sub HeapSiftdown(MyArray(), M)
Dim Index
Dim Parent
Dim TEMP

    Index = 0
    Parent = 2 * Index

    Do While (Parent <= M)
        
        If (Parent < M And MyArray(Parent) < MyArray(Parent + 1)) Then
            Parent = Parent + 1
        End If

        If MyArray(Index) >= MyArray(Parent) Then
            Exit Do
        End If

        TEMP = MyArray(Index)
        MyArray(Index) = MyArray(Parent)
        MyArray(Parent) = TEMP
        
        Index = Parent
        Parent = 2 * Index

        gIterations = gIterations + 1
    Loop
End Sub

Sub HeapSiftup(MyArray(), M)
Dim Index
Dim Parent
Dim TEMP

    Index = M
    Do While (Index > 0)
        Parent = Int(Index / 2)

        If MyArray(Parent) >= MyArray(Index) Then
            Exit Do
        End If
        
        TEMP = MyArray(Index)
        MyArray(Index) = MyArray(Parent)
        MyArray(Parent) = TEMP

        Index = Parent
        gIterations = gIterations + 1
    Loop
    
End Sub

Sub Insertion(MyArray(), ByVal nOrder As Integer)
Dim Index
Dim TEMP
Dim NextElement
    
    NextElement = LBound(MyArray) + 1
    While (NextElement <= UBound(MyArray))
        Index = NextElement
        Do
            If Index > LBound(MyArray) Then
                If nOrder = ASCENDING_ORDER Then
                    If MyArray(Index) < MyArray(Index - 1) Then
                        TEMP = MyArray(Index)
                        MyArray(Index) = MyArray(Index - 1)
                        MyArray(Index - 1) = TEMP
                        Index = Index - 1
                    Else
                        Exit Do
                    End If
                ElseIf nOrder = DESCENDING_ORDER Then
                    If MyArray(Index) >= MyArray(Index - 1) Then
                        TEMP = MyArray(Index)
                        MyArray(Index) = MyArray(Index - 1)
                        MyArray(Index - 1) = TEMP
                        Index = Index - 1
                    Else
                        Exit Do
                    End If
                End If
            Else
                Exit Do
            End If
            gIterations = gIterations + 1
        Loop
        NextElement = NextElement + 1
        gIterations = gIterations + 1
    Wend

End Sub

Sub QuickSort(MyArray(), L, R)
Dim I, J, X, Y

    I = L
    J = R
    X = MyArray((L + R) / 2)
        
    While (I <= J)
        While (MyArray(I) < X And I < R)
            I = I + 1
        Wend
        While (X < MyArray(J) And J > L)
            J = J - 1
        Wend
        If (I <= J) Then
            Y = MyArray(I)
            MyArray(I) = MyArray(J)
            MyArray(J) = Y
            I = I + 1
            J = J - 1
        End If
        gIterations = gIterations + 1
    Wend

    If (L < J) Then Call QuickSort(MyArray(), L, J)
    If (I < R) Then Call QuickSort(MyArray(), I, R)

End Sub

Sub Selection(MyArray(), ByVal nOrder As Integer)
Dim Index
Dim Min
Dim NextElement
Dim TEMP

    NextElement = 0
    While (NextElement < UBound(MyArray))
        Min = UBound(MyArray)
        Index = Min - 1
        While (Index >= NextElement)
            If nOrder = ASCENDING_ORDER Then
                If MyArray(Index) < MyArray(Min) Then
                    Min = Index
                End If
            ElseIf nOrder = DESCENDING_ORDER Then
                If MyArray(Index) >= MyArray(Min) Then
                    Min = Index
                End If
            End If
            Index = Index - 1
            gIterations = gIterations + 1
        Wend
        TEMP = MyArray(Min)
        MyArray(Min) = MyArray(NextElement)
        MyArray(NextElement) = TEMP
        NextElement = NextElement + 1
        gIterations = gIterations - 1
    Wend

End Sub

Sub ShellSort(MyArray(), ByVal nOrder As Integer)
Dim Distance
Dim Size
Dim Index
Dim NextElement
Dim TEMP

    Size = UBound(MyArray) - LBound(MyArray) + 1
    Distance = 1

    While (Distance <= Size)
        Distance = 2 * Distance
    Wend

    Distance = (Distance / 2) - 1
    
    While (Distance > 0)
    
        NextElement = LBound(MyArray) + Distance
    
        While (NextElement <= UBound(MyArray))
            Index = NextElement
            Do
                If Index >= (LBound(MyArray) + Distance) Then
                    If nOrder = ASCENDING_ORDER Then
                        If MyArray(Index) < MyArray(Index - Distance) Then
                            TEMP = MyArray(Index)
                            MyArray(Index) = MyArray(Index - Distance)
                            MyArray(Index - Distance) = TEMP
                            Index = Index - Distance
                            gIterations = gIterations + 1
                        Else
                            Exit Do
                        End If
                    ElseIf nOrder = DESCENDING_ORDER Then
                        If MyArray(Index) >= MyArray(Index - Distance) Then
                            TEMP = MyArray(Index)
                            MyArray(Index) = MyArray(Index - Distance)
                            MyArray(Index - Distance) = TEMP
                            Index = Index - Distance
                            gIterations = gIterations + 1
                        Else
                            Exit Do
                        End If
                    End If
                Else
                    Exit Do
                End If
            Loop
            NextElement = NextElement + 1
            gIterations = gIterations + 1
        Wend
        Distance = (Distance - 1) / 2
        gIterations = gIterations + 1
    Wend
    
End Sub

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区日韩在线观看| 色拍拍在线精品视频8848| 亚洲成人中文在线| 亚洲欧洲制服丝袜| 国产精品电影一区二区| 国产精品久久久久久久浪潮网站| 中文字幕第一页久久| 亚洲国产精品成人久久综合一区| 久久精品视频在线免费观看 | 国产精品视频免费看| 久久色成人在线| 久久一日本道色综合| 久久精品这里都是精品| 亚洲国产精品精华液ab| 国产精品久久免费看| 18欧美亚洲精品| 亚洲精品成人少妇| 亚洲国产精品一区二区久久恐怖片| 亚洲一区二区三区在线看| 午夜激情久久久| 蜜桃91丨九色丨蝌蚪91桃色| 久久精品国产成人一区二区三区 | 国产精品理伦片| 亚洲天堂成人网| 亚洲精品日日夜夜| 天堂av在线一区| 麻豆久久久久久| 国产91丝袜在线播放九色| 不卡区在线中文字幕| 色成年激情久久综合| 欧美男同性恋视频网站| 欧美一级一区二区| 久久久久久久久久久久电影| 最新国产の精品合集bt伙计| 亚洲高清在线精品| 久久精品国产一区二区三 | 99这里只有精品| 欧美日韩国产美女| 久久看人人爽人人| 亚洲日本乱码在线观看| 日韩高清不卡一区二区| 懂色av一区二区夜夜嗨| 欧美亚洲日本国产| 久久伊人蜜桃av一区二区| 亚洲精品亚洲人成人网在线播放| 日韩成人一区二区三区在线观看| 国产精品综合一区二区三区| 色婷婷综合久色| 久久亚洲一区二区三区四区| 亚洲三级在线播放| 美腿丝袜亚洲一区| 日本国产一区二区| 精品国产91久久久久久久妲己| 亚洲视频在线一区| 极品瑜伽女神91| 欧美视频在线一区二区三区| 精品国产免费人成电影在线观看四季 | voyeur盗摄精品| 91精品婷婷国产综合久久性色| 欧美国产日本韩| 日韩高清一区二区| 在线看国产一区| 欧美激情在线看| 免费成人深夜小野草| 色综合久久久网| 久久精品亚洲麻豆av一区二区 | 丁香婷婷综合五月| 欧美精品v日韩精品v韩国精品v| 国产精品国产三级国产aⅴ无密码| 日本视频免费一区| 色综合一区二区| 国产视频一区不卡| 三级在线观看一区二区| 色综合中文字幕| 国产精品久线在线观看| 国产一区二区视频在线播放| 欧美人与禽zozo性伦| 亚洲欧美综合另类在线卡通| 国内不卡的二区三区中文字幕 | 亚洲欧美自拍偷拍| 国产精品影视天天线| 欧美电影一区二区| 亚洲人成网站色在线观看| 国产suv一区二区三区88区| 日韩你懂的在线观看| 婷婷中文字幕一区三区| 91久久线看在观草草青青| 国产亚洲欧美激情| 激情久久五月天| 日韩一区二区在线播放| 亚洲成人自拍网| 欧美视频一二三区| 亚洲国产日产av| 欧美色图一区二区三区| 亚洲综合激情另类小说区| 波多野结衣亚洲| 亚洲国产岛国毛片在线| 国产老肥熟一区二区三区| 久久这里只精品最新地址| 国产综合色在线| 26uuu亚洲| 久久99国产精品麻豆| 精品久久久久久久久久久久久久久 | 人人精品人人爱| 欧美精品久久99久久在免费线| 亚洲自拍另类综合| 欧美色图一区二区三区| 亚洲线精品一区二区三区八戒| 欧美性一区二区| 亚洲国产精品一区二区久久恐怖片 | 国产自产v一区二区三区c| 精品久久久三级丝袜| 国产一区二区三区高清播放| 久久精品一区二区三区不卡牛牛| 国产精品亚洲午夜一区二区三区 | 久久久久久久国产精品影院| 国产一区二区在线看| 国产三级三级三级精品8ⅰ区| 国产成人综合在线观看| 欧美激情一区二区在线| 91美女片黄在线观看| 亚洲黄色免费网站| 欧美日韩中字一区| 热久久国产精品| 久久久久九九视频| 成人av免费在线观看| 亚洲免费观看高清完整版在线| 欧美性videosxxxxx| 久久精品久久99精品久久| 国产视频一区二区在线观看| 91在线无精精品入口| 天堂久久久久va久久久久| 日韩欧美三级在线| 国产成人精品免费看| 亚洲综合精品久久| 欧美成人a∨高清免费观看| 国产99久久久久久免费看农村| 亚洲视频香蕉人妖| 日韩午夜激情视频| 成人精品鲁一区一区二区| 亚洲精品欧美综合四区| 91麻豆精品国产91| 国产成人免费高清| 亚洲精品综合在线| 日韩一区和二区| 成人激情av网| 免费日韩伦理电影| 中文字幕制服丝袜一区二区三区 | 国产91丝袜在线播放九色| 一区二区三区四区中文字幕| 日韩一级大片在线观看| 丁香六月久久综合狠狠色| 亚洲一区二区欧美| 久久久不卡网国产精品一区| 色嗨嗨av一区二区三区| 国产专区欧美精品| 亚洲国产精品综合小说图片区| 久久精品日产第一区二区三区高清版| 一本高清dvd不卡在线观看| 美女爽到高潮91| 亚洲精品一二三| 久久久久高清精品| 欧美精品丝袜久久久中文字幕| 国产传媒久久文化传媒| 日韩电影在线一区| 中文字幕综合网| 欧美xxx久久| 精品视频一区二区三区免费| 国产精品影视在线观看| 日日欢夜夜爽一区| 亚洲欧美一区二区三区孕妇| 亚洲精品在线一区二区| 欧美色老头old∨ideo| 国产成人精品网址| 蜜乳av一区二区三区| 一区二区成人在线观看| 国产精品三级在线观看| 欧美sm极限捆绑bd| 欧美剧情电影在线观看完整版免费励志电影 | 欧美成人官网二区| 欧美日韩五月天| 91亚洲永久精品| 国产成人日日夜夜| 日韩精品国产欧美| 亚洲精品美国一| 日韩毛片一二三区| 国产欧美中文在线| 精品少妇一区二区三区免费观看 | 中文av一区特黄| 精品99一区二区三区| 欧美猛男超大videosgay| 色婷婷综合在线| 色婷婷久久一区二区三区麻豆| 成人一区二区三区在线观看| 国产一区二区免费视频| 精品制服美女久久| 久久99国产精品久久99| 青青草国产成人av片免费| 午夜电影久久久| 亚洲香蕉伊在人在线观|