C# 0 The Complete Reference


List . You can get or set the value within a node by using  Value



Download 4,07 Mb.
Pdf ko'rish
bet973/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   969   970   971   972   973   974   975   976   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

List

. You can get or set the value within a node by using 



Value

.

www.freepdf-books.com




784

 

P a r t   I I :  



E x p l o r i n g   t h e   C #   L i b r a r y

LinkedList

 defines many methods. A sampling is shown in Table 24-15. In addition 

to the properties defined by the interfaces that it implements, 

LinkedList

 defines these 

properties:

public LinkedListNode First { get; }

public LinkedListNode Last { get; }

First

 obtains the first node in the list. 



Last

 obtains the last node in the list.

Method

Description



public LinkedListNode

    AddAfter(LinkedListNode 



n

, T 


v

)

Adds a node with the value 



v

 to the list immediately 

after the node specified by 

n.

 The node passed in 



n

must not be 

null

. Returns a reference to the node 



containing the value 

v.

public void

    AddAfter(LinkedListNode 

n

,

LinkedListNode



new

)

Adds the node passed in 



new

 to the list immediately 

after the node specified by 

n.

 The node passed in 



n

must not be 

null

. Throws an 



InvalidOperationException

if

n

 is not in the list or if 

new

 is par t of another list.

public LinkedListNode

    AddBefore(LinkedListNode n, T v)

Adds a node with the value 

v

 to the list immediately 

before the node specified by 

n

. The node passed in 



n

 must not be 

null

. Returns a reference to the node 



containing the value 

v

.

public void



    AddBefore(LinkedListNode 

n

,

                    LinkedListNode 



new

)

Adds the node passed in 



new

 to the list immediately 

before the node specified by 

n.

 The node passed in 



n

must not be 

null

. Throws an 



InvalidOperationException

if

n

 is not in the list or if 

new

 is par t of another list.

public LinkedList AddFirst( T 

v

)

Adds a node with the value 



v

 to the star t of the list. 

Returns a reference to the node containing the value 

v.

public void AddFirst(LinkedListNode 



new

)

Adds 



new

 to the star t of the list. Throws an 

InvalidOperationException

 if 


new

 is par t of another list.

public LinkedList AddLast( T 

v

)

Adds a node with the value 



v

 to the end of the list. 

Returns a reference to the node containing the value 

v.

public void AddLast(LinkedListNode 



new

)

Adds 



new

 to the end of the list. Throws an 

InvalidOperationException

 if 


new

 is par t of another list.

public LinkedList Find(T 

v

)

Returns a reference to the first node in the list that has 



the value 

v.

null


 is returned if 

v

 is not in the list.

public LinkedList FindLast(T 

v

)

Returns a reference to the last node in the list that has 



the value 

v.

null


 is returned if 

v

 is not in the list.

public bool Remove(T 

v

)

Removes the first node in the list that has the value 



v.

 Returns true if the node was removed. (That is, 

if a node with the value 

v

 was in the list and it was 

removed.) Returns false other wise.

T

ABLE



 24-15 

A Sampling of Methods Defi ned by 

LinkedList

www.freepdf-books.com




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   969   970   971   972   973   974   975   976   ...   1096




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish