MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Insertion into sorted list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71055] Re: Insertion into sorted list
  • From: dh <dh at metrohm.ch>
  • Date: Wed, 8 Nov 2006 06:00:05 -0500 (EST)
  • References: <eimq10$9b7$1@smc.vnet.net>

Hi Andrew,
I would try a binary search for the insertion point and then use Insert.
Daniel

Andrew Moylan wrote:
> Hi all,
> 
> I have a sorted List. I need to occasionally insert new elements, while
> always keeping the list sorted. Is there a more efficient way to do
> this than the most obvious way (calling Append then calling Sort)?
> 
> Thanks for any help,
> 
> Andrew
> 


  • Prev by Date: Re: Insertion into sorted list
  • Next by Date: $PathnameSeparator and DirectoryName
  • Previous by thread: Re: Insertion into sorted list
  • Next by thread: Re: Insertion into sorted list