Re: Single Liked List Problem at Java



On Mon, 16 Jun 2008 09:31:50 -0700 (PDT), bbbb <vmavrou@xxxxxxxxx>
wrote:

my problem is how to get the k position and not only the first or last
for insertion or deletion.
Do you have a function that moves from one list item to the next list
item? It is often called "next()". You can find the k'th item (if it
exists) by using next() from the start of the list.

Have a look at the List and List<T> interfaces in the Java
documentation, there are lots of ideas there for what you need in an
implementation of a list.

rossum

.



Relevant Pages

  • Re: looking for name for data structure
    ... except that it supports insertion and deletion in the middle ... across time/space is possible by warping (putting a wrinkle into) ... time/space so that two otherwise distant points touch. ...
    (comp.programming)
  • Re: malloc() vs "new" vs HeapAlloc() vs ...
    ... CMap-type of hash, where you tweak the hash parameters to minimize conflicts in the hash ... >> big difference for a huge sequence. ... >insertion or deletion, you normally have to do an Otraversal to ... >that insertion or deletion in the middle of the sequence O. ...
    (microsoft.public.vc.mfc)
  • Re: Track Changes
    ... time you make a typo the corrections to the typo are also tracked. ... an insertion and deletion are made by the same author then the ... deletion will not be tracked. ... the track changes are all on. ...
    (microsoft.public.word.application.errors)
  • Re: seeking music notation editor with insert/delete
    ... When NoteEdit was still alive, ... sequence of notes and rests won't flow over them. ... notation editor that supports insertion and deletion similarly to ...
    (comp.os.linux.misc)
  • Re: [RFC][PATCH -mm] swsusp: Use rbtree for tracking allocated swap
    ... Insertion cost for rb_node includes keeping the tree balanced. ... Deletion could would include rebalancing for the rb_nodes. ... the chains in an image header and iterating through a group of chains ... care about searching. ...
    (Linux-Kernel)