Results 1 to 6 of 6
  1. #1
    smacker is offline Member
    Join Date
    Jan 2011
    Posts
    46
    Rep Power
    0

    Default a linked list question

    having a hard time grasping how to work this
    i have a polynom linked list and i need to add a Node somewhere in the middle for example the 4th place

    the question is how do i run on the linked list
    i made this function
    public polynom insert (int place , Monom data , polynom tmp)

    and i need to get to the fourth place how do i run on it without running over previous nodes

    i hope it was clear enough
    thanks to all the helpers !

  2. #2
    goldest's Avatar
    goldest is offline Senior Member
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    469
    Rep Power
    5

    Wink

    Why don't you take a look at the the LinkedList API : LinkedList

    You will find some methods like add(int index, E element) which might help you out.

    Hope that helps,

    Goldest
    Java Is A Funny Language... Really!
    Click on * and add to member reputation, if you find their advices/solutions effective.

  3. #3
    smacker is offline Member
    Join Date
    Jan 2011
    Posts
    46
    Rep Power
    0

    Default

    umm yea that's what i need to build
    i can't use the made one

  4. #4
    goldest's Avatar
    goldest is offline Senior Member
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    469
    Rep Power
    5

    Wink

    Quote Originally Posted by smacker View Post
    umm yea that's what i need to build
    i can't use the made one
    ...And there is no point in re-inventing the wheel unless you want to make it square this time around. :p

    Goldest
    Java Is A Funny Language... Really!
    Click on * and add to member reputation, if you find their advices/solutions effective.

  5. #5
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    I'm guessing it's an assignment.

  6. #6
    smacker is offline Member
    Join Date
    Jan 2011
    Posts
    46
    Rep Power
    0

    Default

    lol Goldest
    yea it's an assignment
    but i think i figured it out after two weeks of working on it :D

Similar Threads

  1. Replies: 4
    Last Post: 02-21-2011, 09:34 AM
  2. n00b: linked list question
    By ankitmcgill in forum New To Java
    Replies: 2
    Last Post: 03-13-2009, 04:15 AM
  3. [SOLVED] Linked list question
    By ztrath in forum New To Java
    Replies: 8
    Last Post: 03-11-2009, 11:38 PM
  4. Revised Linked List printing method question
    By CirKuT in forum New To Java
    Replies: 7
    Last Post: 12-12-2008, 10:21 PM
  5. Linked List Question
    By CirKuT in forum New To Java
    Replies: 4
    Last Post: 12-10-2008, 06:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •