Message-Id: <339840F5.4280@juno.com> Date: Fri, 06 Jun 1997 09:55:17 -0700 From: Ben Shadwick Mime-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: LinkedLists References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Timothy Robb wrote: > I've given up on Quick Sorting my list because I will be adding one item > at a time to it and the add function will call the sort function, as a > result Insertion Sort would probably be the best method. > > My next problem is binary searching through a linked list.... You'd probably be better off turning your linked list into a binary search tree (a sorted tree), which, if a good tree is built, yields a searching performance comparable to that of a binary search when used on contiguous lists (arrays). Binary search and quicksort are really bad for use on linked lists because the elements in a linked list cannot each be accessed in the same amount of time (i.e. linked lists don't have random access). Ben Shadwick, Sysop, Mars Base BBS, (360)882-0773, Vancouver, WA, USA email: bshadwick AT juno DOT com >> SPAMMING WILL NOT BE TOLERATED << Have a nice day!