1

如何在VB.NET中使用类实现线性链表?

这个类如何修改为线性链表?

还有遍历列表、删除节点等的方法。

Public Class clsHol
    Private dt As Date
    Private tp As String
    Private remark As String

    Public Function setValues(ByVal d As Date, ByVal t As String, ByVal r As String)
        remark = r
        tp = t
        remark = r
    End Function

    Public Function getDate()
        Return dt
    End Function

    Public Function getTyp()
        Return tp
    End Function

    Public Function getRemark()
        Return remark
    End Function
End Class
4

1 回答 1

1

样本:

Sub Main()
    Dim voLList As New LinkedList(Of clsHol)

    voLList.AddFirst(new clsHol())
    voLList.AddLast(new clsHol())
    voLList.AddLast(new clsHol())
End Sub
于 2013-03-03T15:13:07.770 回答