what's standard Node class methods for singly linkedlist in java? -
i'm solving problem on http://www.hackerrank.com related linkedlists, in i've use node class, didn't find node class linkedlists in built library standard one, i've make own. this, problem online, doesn't let me include own node class code i've use : if there standard node class. when use functions defined me found online, gives lot of errors these functions aren't named same did. don't figure out do. here's class:
public class node{ private object element; private node nextnode; public node(object data, node node){ element = data; nextnode = node; } public object getelement(){ return element; } public node getnext(){ return nextnode; } public void setnext(node node) { nextnode = node; } } the problem : names gave functions aren't same accepted site. may getnext getdata or that. there standard system name?
the link gave says this:
/* insert node @ end of linked list head pointer input null empty list node defined class node { int data; node next; } */
Comments
Post a Comment