55 EST_String strings[] = {
"quail",
"wood pigeon",
"eagle",
"emu",
"rook" };
64 for (
unsigned int i1 = 0; i1 <
sizeof(strings) /
sizeof(strings[0]); i1++)
72 for (p = slist.
head(); p != 0; p = p->
next())
73 if (slist(p) ==
"eagle")
82 cout <<
"[ List Accessed by LItem\n";
84 for (p = slist.
head(); p != 0; p = p->
next())
85 cout <<
" " << slist(p) <<
"\n";
91 cout <<
"\n[ List Accessed by integer index\n";
92 for (
int i2 = 0; i2 < slist.
length(); ++i2)
93 cout <<
" " << slist.
nth(i2) <<
"\n";
101 for (p = slist.
head(); p != 0; p = p->
next())
102 slist(p).gsub(
"e",
"E");
106 cout <<
"Last item: " << slist(p) << endl;
109 cout <<
"Last item: " << slist.
last() << endl;
112 cout <<
"First item: " << slist.
first() << endl;
115 cout <<
"4th item: " << slist.
nth(4) << endl;
121 slist.
first() =
"Swallow";
122 slist.
last() =
"TurkEy";
123 slist.
nth(2) =
"SEagull";
127 cout <<
"\n[ List After Substitutions and Replacements\n";
128 for (p = slist.
head(); p != 0; p = p->
next())
129 cout <<
" " << slist(p) <<
"\n";
140 for (p = slist.
head(); p != 0; p = p->
next())
141 if (slist(p) ==
"EaglE")
146 cout <<
"\n[ List After Removing Eagle\n";
147 for (p = slist.
head(); p != 0; p = p->
next())
148 cout <<
" " << slist(p) <<
"\n";
156 cout <<
"\n[ List After Reverse\n";
157 for (p = slist.
head(); p != 0; p = p->
next())
158 cout <<
" " << slist(p) <<
"\n";
166 cout <<
"\n[ Sorted\n";
167 for(p=slist.
head(); p ; p=p->
next())
168 cout <<
" " << slist(p) <<
"\n";
174 cout <<
"\n[ Sorted by second character\n";
175 for(p=slist.
head(); p ; p=p->
next())
176 cout <<
" " << slist(p) <<
"\n";
188 return (
bool)(val1->
val(1) > val2->
val(1));
void qsort(EST_TList< T > &a)
EST_Litem * insert_before(EST_Litem *ptr, const T &item)
const T & last() const
return const reference to last item in list
T & nth(int n)
return the Nth value
const T & first() const
return const reference to first item in list
void append(const T &item)
add item onto end of list
void sort(EST_TList< T > &a)
bool second_char_gt(const EST_UItem *uv1, const EST_UItem *uv2)
EST_Litem * insert_after(EST_Litem *ptr, const T &item)
EST_Litem * remove(EST_Litem *ptr)
void prepend(const T &item)
add item onto start of list