PDA

View Full Version : problem removing first node in linkedlist (java)



Mia_tech
June 18th, 2012, 12:29 AM
guys, I have a linked list, which contains the following

firstname lastname gpa major club

the list is sorted in ascending order by firstname. However, I'm having problems removing the first element on the list (only the first element) I have no problem removing any other element, and I think is b/c given my "remove" method the first time it goes through the list the value of "previous" is null; therefore, is assigning

and it doesn't know what current.next is... how could I fix this in order to be able to remove the first element in the list

Mia_tech
June 18th, 2012, 12:40 AM
never mind... I figured it out!...