📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Demonstrating class CTree"
ClientHeight = 2460
ClientLeft = 60
ClientTop = 345
ClientWidth = 3495
LinkTopic = "Form1"
ScaleHeight = 2460
ScaleWidth = 3495
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdInsert
Caption = "Insert"
Height = 285
Left = 1800
TabIndex = 3
Top = 240
Width = 1695
End
Begin VB.CommandButton cmdTraversals
Caption = "Do traversals"
Height = 285
Left = 900
TabIndex = 2
Top = 600
Width = 1695
End
Begin VB.TextBox txtInput
Height = 285
Left = 0
TabIndex = 0
Top = 240
Width = 1695
End
Begin VB.Label lblPostorder
Caption = "The postorder traversal is:"
Height = 255
Left = 0
TabIndex = 9
Top = 1920
Width = 3375
End
Begin VB.Label lblPostorderResult
Height = 255
Left = 0
TabIndex = 8
Top = 2160
Width = 3495
End
Begin VB.Label lblPreorder
Caption = "The preorder traversal is:"
Height = 255
Left = 0
TabIndex = 7
Top = 1440
Width = 3375
End
Begin VB.Label lblPreorderResult
Height = 255
Left = 0
TabIndex = 6
Top = 1680
Width = 3495
End
Begin VB.Label lblInorderResult
Height = 255
Left = 0
TabIndex = 5
Top = 1200
Width = 3495
End
Begin VB.Label lblInorder
Caption = "The inorder traversal is:"
Height = 255
Left = 0
TabIndex = 4
Top = 960
Width = 3375
End
Begin VB.Label lblInput
Caption = "Enter value to insert"
Height = 255
Left = 0
TabIndex = 1
Top = 0
Width = 2655
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig. 21.15
' Demonstrating class CTree
Option Explicit
Dim mTree As New CTree
Private Sub cmdInsert_Click()
mTree.InsertNode (Val(txtInput.Text))
End Sub
Private Sub cmdTraversals_Click()
Call mTree.InorderTraversal
lblInorderResult.Caption = mTree.Output
Call mTree.PreorderTraversal
lblPreorderResult.Caption = mTree.Output
Call mTree.PostorderTraversal
lblPostorderResult.Caption = mTree.Output
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -