Finally I've made a small improvement to the list method as well so that we return earlier:ĭownload drama korea who are you school 2015 episode 13. Please also notice that your check before ( if(head.nexttail)) was also throwing NullPointerException because at the beginning the head is always null so you cannot access the next member. Notice that at the end of insert I'm increasing the size so that the list method doesn't throw a NullPointerException every time we call it.
This one is not working properly because you forgot to increment and decrement the size when you insert or remove. You were always missing on the first element from the file.Īnother problem is the Queues class (which by the way is misspelled you should replace O with Q). Just add it if it's not null and then read the next line. Notice that unlike your solution I first do the push y.Push(line) so that we don't forget to add whatever is already read into line. I'm going to point out a few and let you work to fix the rest because this looks like an assignment and I don't want to do your homework for you :).įirst, when you read from the file be careful not to ignore the first element: