I am creating a linked list function for homework that eventually adds to any pointer, but I understand No matter how
81,0,0,0,0 , which means that after , comes back in every cycle of code. How do I create it after this? To maintain the number after this? Public Zero addToIndexAt (int n, int index) {IntList addition = new IntList (n); If (index == 0) {// it's my problem intList start = it; = IntList after this; IntList current = this; IntList temp = this; While (after.tail! = Null) {after = after.tail; Temporary = after; After.head = current.head; } Beginning .head = n; } And {after install = this; = IntList before this; Int newfire = index; Int nbefore = index; While (Nature & gt; 0) {after = after.tail; Nafter--; } Addition.tail = after; While (nbefore> 1) {before = before.tail; Nbefore--; } Before.tail = addition; It seems that you are treating a list of node classes as same as the class. For me, these are different I suggest making a class in the list which refers to the first node in the list. Alternatively, you can try to change your code slightly, where the inserting method gives the new head of the list.
Comments
Post a Comment