4 Replies Latest reply: Apr 18, 2010 2:41 PM by 843789 RSS

    LinkedList add function

    843789
      Here is the function is question.

      This is taken from the java API.
      void add(int index, Object element) 
      say you have an integer linked list created that contains the following

      2-> 4-> 6-> 8

      if you call the following
      add(5,10)
      what would happen to the 4th index?

      would the list become

      2->4->6->8->NULL->10

      or am I missing something?