<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE>RE: [LCP]linked list question</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>&gt; Now I found that when allocating new nodes it would be </FONT>
<BR><FONT SIZE=2>&gt; quickest to add </FONT>
<BR><FONT SIZE=2>&gt; them on the head-end rather than the tail-end. Obviously with the </FONT>
<BR><FONT SIZE=2>&gt; disadvantage, of the nodes appearing in reverse.</FONT>
</P>

<P><FONT SIZE=2>It may not apply, but using a double linked list (eg ptrs to both</FONT>
<BR><FONT SIZE=2>previous and next node) would make the speed question solved, with</FONT>
<BR><FONT SIZE=2>a minimal memory overhead (eg one ptr per attachment is probably</FONT>
<BR><FONT SIZE=2>very negligible).</FONT>
<BR><FONT SIZE=2>Moreover, since you'll most likely use some kind of malloc, and</FONT>
<BR><FONT SIZE=2>that the number of attachments probably won't go to the hundreds,</FONT>
<BR><FONT SIZE=2>the time spent walking the list will be dwarved by the the other</FONT>
<BR><FONT SIZE=2>processing.</FONT>
</P>

<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Vincent Penquerc'h </FONT>
</P>

</BODY>
</HTML>