java - Outputting null -


I am having a problem in which the output of the list (n + 1) returns empty output rather than returning . Is there something I see?

  Public Stable ListEnginement Millitem (Listmill Head, Int N) {if (n == 0) {return head; } And if (head == zero) {return tap; } And {return getItem (head.getNext (), n + 1); }}    

This code does not understand. If the head is not empty, then it will call getItem (head.getNext (), n + 1) , but in the end, head will be null < / Code> (and n will never go to) and so it will return you null maybe you mean

return getItem (head .getNext (), n-1) .

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -