Professional Documents
Culture Documents
Dsa-Lab Evaluation A.Sai Varun AM - EN.U4AIE21120: Public Class Static Class Public Int Public Node
Dsa-Lab Evaluation A.Sai Varun AM - EN.U4AIE21120: Public Class Static Class Public Int Public Node
A.SAI VARUN
AM.EN.U4AIE21120
}
}
if (position == 1)
{
Node newNode = new Node(data);
newNode.nextNode = headNode;
head = newNode;
}
else
{
while (position != 0) {
if (position == 1) {
Node newNode = NodeGet(data);
newNode.nextNode = headNode.nextNode;
break;
}
headNode = headNode.nextNode;
}
if (position != 1)
System.out.println("Position is out of the given range");
}
return head;
}
//MAIN Method
public static void main(String[] args)
{
OUTPUT: