# data[].attributes.body
class Link {
public int data1;

public Link next;

//Link constructor
public Link(int d1) {
data1 = d1;

}

//Print Link data
public void printLink() {
System.out.print("{" + data1 +  "} ");
}
}
class LinkList {
private Link headptr;

//LinkList constructor
public LinkList() {
headptr = null;
}

//Inserts a new Link at the first of the list
public void insert(int d1) {
Link newptr = new Link(d1);
newptr.next = headptr;
headptr = newptr;
}

public void printList() {
Link currentLink = headptr;
System.out.print("List: ");
while(currentLink != null) {
currentLink.printLink();
currentLink = currentLink.next;
}
System.out.println("");
}

}

class LinkListTest {
public static void main(String[] args) {
LinkList list = new LinkList();

list.insert(7);
list.insert(3);
list.insert(5);
list.insert(1);
list.printList();

}}

# data[].attributes.body
class Link {
public int data1;
public Link nextLink;

//Link constructor
public Link(int d1) {
data1 = d1;
}

//Print Link data
public void printLink() {
System.out.print("{" + data1 + "} ");
}
}

class LinkList {
private Link headptr;

//LinkList constructor
public LinkList() {
headptr = null;
}

//Inserts a new Link at the first of the list
public void insert(int d1) {
Link link = new Link(d1);
link.nextLink = headptr;
headptr = link;
}

public void printList() {
Link currentLink = headptr;
System.out.print("List: ");
while(currentLink != null) {
currentLink.printLink();
currentLink = currentLink.nextLink;
}
System.out.println("");
}

}

class LinkListTest {
public static void main(String[] args) {
LinkList list = new LinkList();

list.insert(7);
list.insert(3);
list.insert(5);
list.insert(1);
list.printList();

}
}

# data[].attributes.body
class Link { public int data1; public Link nextLink; //Link constructor public Link(int d1) { data1 = d1; } //Print Link data public void printLink() { System.out.print("{" + data1 + "} "); } } class LinkList { private Link headptr; //LinkList constructor public LinkList() { headptr = null; } //Inserts a new Link at the first of the list public void insert(int d1) { Link link = new Link(d1); link.nextLink = headptr; headptr = link; } public void printList() { Link currentLink = headptr; System.out.print("List: "); while(currentLink != null) { currentLink.printLink(); currentLink = currentLink.nextLink; } System.out.println(""); } } class LinkListTest { public static void main(String[] args) { LinkList list = new LinkList(); list.insert(1); list.insert(2); list.insert(3); list.insert(4); list.insert(7); list.printList(); } }

# data[].attributes.body
public class Link {

public int data1;
public Link nextLink;

public Link(int d1){
data1=d1;
}
public void printLink(){
System.out.print("{"+data1+"}");
}
}

public class LinkList {
private Link headptr;

public LinkList(){
headptr=null;
}

public void insert(int d1) {
Link link = new Link(d1);
link.nextLink = headptr;
headptr = link;
}

public void printList() {
Link currentLink = headptr;
System.out.print("List: ");
while(currentLink != null) {
currentLink.printLink();
currentLink = currentLink.nextLink;
}
System.out.println("");
}

}

public class LinkListTest {

public static void main(String[] args) {
LinkList list = new LinkList();

list.insert(7);
list.insert(3);
list.insert(5);
list.insert(1);
list.printList();

}
}

# data[].attributes.body
class Link {
public int data1;
public Link nextLink;

//Link constructor
public Link(int d1) {
data1 = d1;
}

//Print Link data
public void printLink() {
System.out.print("{"+data1+"}");
}
}

class LinkList {
private Link headptr;

//LinkList constructor
public LinkList() {
headptr = null;
}

//Inserts a new Link at the first of the list
public void insert(int d1) {
Link link = new Link(d1);
link.nextLink = headptr;
headptr = link;
}

public void printList() {
Link currentLink = headptr;
System.out.print("List: ");
while(currentLink != null) {
currentLink.printLink();
currentLink = currentLink.nextLink;
}
System.out.println("");
}

}

class LinkListTest {
public static void main(String[] args) {
LinkList list = new LinkList();

list.insert(7);
list.insert(3);
list.insert(5);
list.insert(1);
list.printList();

}
}

# data[].attributes.body
class Link { public int data1; public Link nextLink; //Link constructor public Link(int d1) { data1 = d1; } //Print Link data public void printLink() { System.out.print("data1 : "+data1); } } class LinkList { private Link headptr; //LinkList constructor public LinkList() { headptr = null; } //Inserts a new Link at the first of the list public void insert(int d1) { Link link = new Link(d1); link.nextLink = headptr; headptr = link; } public void printList() { Link currentLink = headptr; System.out.print("List: "); while(currentLink != null) { currentLink.printLink(); currentLink = currentLink.nextLink; } System.out.println(""); } } class LinkListTest { public static void main(String[] args) { LinkList list = new LinkList(); list.insert(7); list.insert(3); list.insert(5); list.insert(1); list.printList(); } }

# data[].attributes.body
class Link {
public int data1;
public Link nextLink;

//Link constructor
public Link(int d1) {
data1 = d1;
}

//Print Link data
public void printLink() {
System.out.print("data1 : "+data1);
}
}

class LinkList {
private Link headptr;

//LinkList constructor
public LinkList() {
headptr = null;
}

//Inserts a new Link at the first of the list
public void insert(int d1) {
Link link = new Link(d1);
link.nextLink = headptr;
headptr = link;
}

public void printList() {
Link currentLink = headptr;
System.out.print("List: ");
while(currentLink != null) {
currentLink.printLink();
currentLink = currentLink.nextLink;
}
System.out.println("");
}

}

class LinkListTest {
public static void main(String[] args) {
LinkList list = new LinkList();

list.insert(7);
list.insert(3);
list.insert(5);
list.insert(1);
list.printList();

}
}

# data[].attributes.body
class Link {
public int data1;
public double data2;
public Link nextLink;

//Link constructor
public Link(int d1, double d2) {
data1 = d1;
data2 = d2;
}

//Print Link data
public void printLink() {
System.out.print("{" + data1 + ", " + data2 + "} ");
}
}

class LinkList {
private Link headptr;

//LinkList constructor
public LinkList() {
headptr = null;
}

//Inserts a new Link at the first of the list
public void insert(int d1, double d2) {
Link link = new Link(d1, d2);
link.nextLink = headptr;
headptr = link;
}

public void printList() {
Link currentLink = headptr;
System.out.print("List: ");
while(currentLink != null) {
currentLink.printLink();
currentLink = currentLink.nextLink;
}
System.out.println("");
}

}

class LinkListTest {
public static void main(String[] args) {
LinkList list = new LinkList();

list.insert(1, 7.01);
list.insert(4, 4.02);
list.insert(7, 2.03);
list.insert(3, 6.04);
list.insert(2, 1.05);
list.printList();

}
}