Skip to content

Commit

Permalink
Merge pull request #1250 from IranNeto/master
Browse files Browse the repository at this point in the history
add LinkedList
  • Loading branch information
fineanmol authored Nov 2, 2021
2 parents f1ce6d0 + 67658d1 commit e44a863
Showing 1 changed file with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
public class LinkedList {

public Node head = new Node();

public Node getHead() {
return head;
}

public void setHead(Node head) {
this.head = head;
}

class Node {
private int value;
private Node next;

public int getValue() {
return value;
}

public void setValue(int value) {
this.value = value;
}

public Node getNext() {
return next;
}

public void setNext(Node next) {
this.next = next;
}

public Node(int value, Node next){
this.value = value;
this.next = next;
}

public Node(int value){
this.value = value;
}

public Node(){}
}
}

0 comments on commit e44a863

Please sign in to comment.