|
SNAP Library 2.2, User Reference
2014-03-11 19:15:55
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <ds.h>
Public Types | |
| typedef TLstNd< TVal > * | PLstNd |
Public Member Functions | |
| TLst () | |
| TLst (const TLst &) | |
| ~TLst () | |
| TLst (TSIn &SIn) | |
| void | Save (TSOut &SOut) const |
| TLst & | operator= (const TLst &) |
| void | Clr () |
| bool | Empty () const |
| int | Len () const |
| PLstNd | First () const |
| PLstNd | Last () const |
| TVal & | FirstVal () const |
| TVal & | LastVal () const |
| PLstNd | AddFront (const TVal &Val) |
| PLstNd | AddBack (const TVal &Val) |
| PLstNd | AddFrontSorted (const TVal &Val, const bool &Asc=true) |
| PLstNd | AddBackSorted (const TVal &Val, const bool &Asc=true) |
| void | PutFront (const PLstNd &Nd) |
| void | PutBack (const PLstNd &Nd) |
| PLstNd | Ins (const PLstNd &Nd, const TVal &Val) |
| void | Del (const TVal &Val) |
| void | Del (const PLstNd &Nd) |
| void | DelFirst () |
| void | DelLast () |
| PLstNd | SearchForw (const TVal &Val) |
| PLstNd | SearchBack (const TVal &Val) |
Private Attributes | |
| int | Nds |
| PLstNd | FirstNd |
| PLstNd | LastNd |
Friends | |
| class | TLstNd< TVal > |
| TLstNd< TVal > * TLst< TVal >::AddBackSorted | ( | const TVal & | Val, |
| const bool & | Asc = true |
||
| ) |
| TLstNd< TVal > * TLst< TVal >::AddFrontSorted | ( | const TVal & | Val, |
| const bool & | Asc = true |
||
| ) |
Definition at line 3719 of file ds.h.
{
PLstNd Nd=SearchForw(Val);
if (Nd!=NULL){Del(Nd);}
}
Definition at line 3694 of file ds.h.
{
Assert(Nd!=NULL);
// unchain
if (Nd->PrevNd==NULL){FirstNd=Nd->NextNd;}
else {Nd->PrevNd->NextNd=Nd->NextNd;}
if (Nd->NextNd==NULL){LastNd=Nd->PrevNd;}
else {Nd->NextNd->PrevNd=Nd->PrevNd;}
// add to back
Nd->PrevNd=LastNd; Nd->NextNd=NULL;
if (LastNd!=NULL){LastNd->NextNd=Nd; LastNd=Nd;}
else {FirstNd=Nd; LastNd=Nd;}
}
Definition at line 3680 of file ds.h.
{
Assert(Nd!=NULL);
// unchain
if (Nd->PrevNd==NULL){FirstNd=Nd->NextNd;}
else {Nd->PrevNd->NextNd=Nd->NextNd;}
if (Nd->NextNd==NULL){LastNd=Nd->PrevNd;}
else {Nd->NextNd->PrevNd=Nd->PrevNd;}
// add to front
Nd->PrevNd=NULL; Nd->NextNd=FirstNd;
if (FirstNd!=NULL){FirstNd->PrevNd=Nd; FirstNd=Nd;}
else {FirstNd=Nd; LastNd=Nd;}
}
| TLstNd< TVal > * TLst< TVal >::SearchBack | ( | const TVal & | Val | ) |
| TLstNd< TVal > * TLst< TVal >::SearchForw | ( | const TVal & | Val | ) |