冒泡排序法
2016-05-12 18:12
363 查看
[align=center]Private Sub Command1_Click()
endtime = Now
passtime = endtime - startime
Label2.Caption = Format(endtime, "hh:mm:ss")
Label3.Caption = Format(passtime, "hh:mm:ss")
Command2.Enabled = False
Command1.Enabled = True
End Sub
Private Sub Command2_Click()
Cls
Dim a(100000) As Integer
Dim i As Integer
Dim j As Integer
startime = Now
Label1.Caption = Format(startime, "hh:mm:ss")
[/align]
Label2.Caption = ""
Label3.Caption = ""
Command1.Enabled = False
Command2.Enabled = True
For i = 1 To 100000
a(i) = Int(Rnd * 100)
Print a(i);
Next i
Print
For i = 1 To 99999
For j = i + 1 To 100000
If a(j) > a(i) Then
swap a(i), a(j)
End If
Next j
Next i
For i = 1 To 100000
Print a(i);
Next i
End Sub
Private Sub swap(a As Integer, b As Integer)
Dim t As Integer
t = a
a = b
b = t
End Sub
Private Sub Command1_Click()
endtime = Now
passtime = endtime - startime
Label2.Caption = Format(endtime, "hh:mm:ss")
Label3.Caption = Format(passtime, "hh:mm:ss")
Command2.Enabled = False
Command1.Enabled = True
End Sub
Private Sub Command2_Click()
Cls
Dim a(100000) As Integer
Dim i As Integer
Dim j As Integer
startime = Now
Label1.Caption = Format(startime, "hh:mm:ss")
Label2.Caption = ""
Label3.Caption = ""
Command1.Enabled = False
Command2.Enabled = True
For i = 1 To 100000
a(i) = Int(Rnd * 100)
Print a(i);
Next i
Print
For i = 1 To 99999
For j = i + 1 To 100000
If a(j) > a(i) Then
swap a(i), a(j)
End If
Next j
Next i
For i = 1 To 100000
Print a(i);
Next i
End Sub
Private Sub swap(a As Integer, b As Integer)
Dim t As Integer
t = a
a = b
b = t
End Sub
Private Sub Command1_Click()
endtime = Now
passtime = endtime - startime
Label2.Caption = Format(endtime, "hh:mm:ss")
Label3.Caption = Format(passtime, "hh:mm:ss")
Command2.Enabled = False
Command1.Enabled = True
End Sub
Private Sub Command2_Click()
Cls
Dim a(100000) As Integer
Dim i As Integer
Dim j As Integer
startime = Now
Label1.Caption = Format(startime, "hh:mm:ss")
Label2.Caption = ""
Label3.Caption = ""
Command1.Enabled = False
Command2.Enabled = True
For i = 1 To 100000
a(i) = Int(Rnd * 100)
Print a(i);
Next i
Print
For i
9b2b
= 1 To 99999
For j = i + 1 To 100000
If a(j) > a(i) Then
swap a(i), a(j)
End If
Next j
Next i
For i = 1 To 100000
Print a(i);
Next i
End Sub
Private Sub swap(a As Integer, b As Integer)
Dim t As Integer
t = a
a = b
b = t
End Sub
Private Sub Command1_Click()
endtime = Now
passtime = endtime - startime
Label2.Caption = Format(endtime, "hh:mm:ss")
Label3.Caption = Format(passtime, "hh:mm:ss")
Command2.Enabled = False
Command1.Enabled = True
End Sub
Private Sub Command2_Click()
Cls
Dim a(100000) As Integer
Dim i As Integer
Dim j As Integer
startime = Now
Label1.Caption = Format(startime, "hh:mm:ss")
Label2.Caption = ""
Label3.Caption = ""
Command1.Enabled = False
Command2.Enabled = True
For i = 1 To 100000
a(i) = Int(Rnd * 100)
Print a(i);
Next i
Print
For i = 1 To 99999
For j = i + 1 To 100000
If a(j) > a(i) Then
swap a(i), a(j)
End If
Next j
Next i
For i = 1 To 100000
Print a(i);
Next i
End Sub
Private Sub swap(a As Integer, b As Integer)
Dim t As Integer
t = a
a = b
b = t
End Sub
endtime = Now
passtime = endtime - startime
Label2.Caption = Format(endtime, "hh:mm:ss")
Label3.Caption = Format(passtime, "hh:mm:ss")
Command2.Enabled = False
Command1.Enabled = True
End Sub
Private Sub Command2_Click()
Cls
Dim a(100000) As Integer
Dim i As Integer
Dim j As Integer
startime = Now
Label1.Caption = Format(startime, "hh:mm:ss")
[/align]
Label2.Caption = ""
Label3.Caption = ""
Command1.Enabled = False
Command2.Enabled = True
For i = 1 To 100000
a(i) = Int(Rnd * 100)
Print a(i);
Next i
For i = 1 To 99999
For j = i + 1 To 100000
If a(j) > a(i) Then
swap a(i), a(j)
End If
Next j
Next i
For i = 1 To 100000
Print a(i);
Next i
End Sub
Private Sub swap(a As Integer, b As Integer)
Dim t As Integer
t = a
a = b
b = t
End Sub
Private Sub Command1_Click()
endtime = Now
passtime = endtime - startime
Label2.Caption = Format(endtime, "hh:mm:ss")
Label3.Caption = Format(passtime, "hh:mm:ss")
Command2.Enabled = False
Command1.Enabled = True
End Sub
Private Sub Command2_Click()
Cls
Dim a(100000) As Integer
Dim i As Integer
Dim j As Integer
startime = Now
Label1.Caption = Format(startime, "hh:mm:ss")
Label2.Caption = ""
Label3.Caption = ""
Command1.Enabled = False
Command2.Enabled = True
For i = 1 To 100000
a(i) = Int(Rnd * 100)
Print a(i);
Next i
For i = 1 To 99999
For j = i + 1 To 100000
If a(j) > a(i) Then
swap a(i), a(j)
End If
Next j
Next i
For i = 1 To 100000
Print a(i);
Next i
End Sub
Private Sub swap(a As Integer, b As Integer)
Dim t As Integer
t = a
a = b
b = t
End Sub
Private Sub Command1_Click()
endtime = Now
passtime = endtime - startime
Label2.Caption = Format(endtime, "hh:mm:ss")
Label3.Caption = Format(passtime, "hh:mm:ss")
Command2.Enabled = False
Command1.Enabled = True
End Sub
Private Sub Command2_Click()
Cls
Dim a(100000) As Integer
Dim i As Integer
Dim j As Integer
startime = Now
Label1.Caption = Format(startime, "hh:mm:ss")
Label2.Caption = ""
Label3.Caption = ""
Command1.Enabled = False
Command2.Enabled = True
For i = 1 To 100000
a(i) = Int(Rnd * 100)
Print a(i);
Next i
For i
9b2b
= 1 To 99999
For j = i + 1 To 100000
If a(j) > a(i) Then
swap a(i), a(j)
End If
Next j
Next i
For i = 1 To 100000
Print a(i);
Next i
End Sub
Private Sub swap(a As Integer, b As Integer)
Dim t As Integer
t = a
a = b
b = t
End Sub
Private Sub Command1_Click()
endtime = Now
passtime = endtime - startime
Label2.Caption = Format(endtime, "hh:mm:ss")
Label3.Caption = Format(passtime, "hh:mm:ss")
Command2.Enabled = False
Command1.Enabled = True
End Sub
Private Sub Command2_Click()
Cls
Dim a(100000) As Integer
Dim i As Integer
Dim j As Integer
startime = Now
Label1.Caption = Format(startime, "hh:mm:ss")
Label2.Caption = ""
Label3.Caption = ""
Command1.Enabled = False
Command2.Enabled = True
For i = 1 To 100000
a(i) = Int(Rnd * 100)
Print a(i);
Next i
For i = 1 To 99999
For j = i + 1 To 100000
If a(j) > a(i) Then
swap a(i), a(j)
End If
Next j
Next i
For i = 1 To 100000
Print a(i);
Next i
End Sub
Private Sub swap(a As Integer, b As Integer)
Dim t As Integer
t = a
a = b
b = t
End Sub
相关文章推荐
- Android应用如何监听自己是否被卸载及卸载反馈功能的实现(第三版)
- 对9种方法的十个数求和的总结
- PHP之——thinkphp3.x中数据的查询-区间查询、统计查询等等
- java string byte之间的转换
- curl和wget
- 选择法
- 高级排序
- my information
- 随机产生一百个数并排序
- 可变数组
- 重要的博客资源链接
- 冒泡排序100个数的
- 引入第三方library报错
- 冒泡
- docker中删除镜像的描述
- Android中基于HTTP协议的网络访问的两种方式
- Oracle char、varchar、varchar2、nvarchar、nvarchar2、nchar比较
- Apache server结合Tomcat配置集群与负载均衡
- oracle常用数据字典
- 文章标题