Create a Linked List
  • node
  • linkedlist
  • stackqueuelinkedlist
  •   
  • Posted: 7 years ago
  • Edit
  • answers (1)
  • views (3672)
  • Comments (1)

Write a function to create a Linked List.


user enter a sentence through command line parsing (do not use – scanf, fscanf, getc, fgetc or similar). The sentence is then st - posted 4 years ago @lydia_tao

Posted Answers

public class Node{
Node next = null;
int data;

public Node(int d)
data = d;

public void appendToTail(int d){
Node end = new Node(d);
Node n = this;
while(n.next! = null)
n = n.next;
n.next = end;
}
}

You need to Sign In to post your solution.