Re: finding the middle of a linked list in one iteration
- From: Nigel <nigel.redding@xxxxxxxxx>
- Date: Wed, 29 Apr 2009 07:17:48 -0700 (PDT)
On Apr 29, 12:57 am, arnuld <sunr...@xxxxxxxxxxxxxxx> wrote:
I searched all the archives of the this newsgroup but did not findInserting an element at a given position in a list is practical. Text
anything on the solution to this problem except this one long
discussion from comp.lang.c, where people claim that its impossible:http://groups.google.com/group/comp.lang.c/browse_thread/thread/15fe9...
My colleague has solved this impossible problem, down here is the code.
There is one thing I want to ask for, is finding the middle of a linked
list is really of any practical benefit ? I have never seen anyone using
it. Even inserting an element at a given position in the linked list (an
exercise from Data Structures and Algorithms by Aho, Hopcraft and Ullman)
does not seem to make any sense to me, I am programming from 1 year and my
colleague is programming from last 3 years and none of us have used
insertion at some place inside the linked list or finding the middle of a
linked list.
--www.lispmachine.wordpress.com
my email is @ the above blog.
editors often represent their data as a linked list, and it would be
useful to be able to insert text at the given cursor position. Note
that this would be faster than if an array of lines was used.
.
- Prev by Date: Re: doing things with binary trees
- Next by Date: Re: Inversion of an algorithm
- Previous by thread: doing things with binary trees
- Next by thread: Re: finding the middle of a linked list in one iteration
- Index(es):
Relevant Pages
|