Answers for "Write a java program to merge three singly linked list elements"

0

Write a java program to merge three singly linked list elements

public class Main{ Node head; static class Node { int data; Node next; Node(int d) {data = d;next=null; } } public void display() { Node n = head; while (n != null) { System.out.print(n.data+" \n"); n = n.next; } } public static void main(String[] args) { Main Main = new Main(); Main.head = new Node(10); Node second = new Node(15); Node third = new Node(20); Main.head.next = second; second.next = third; Main.display(); } }
Posted by: Guest on June-10-2021

Code answers related to "Write a java program to merge three singly linked list elements"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language