write a java program to merge three singly linked list elements

Solutions on MaxInterview for write a java program to merge three singly linked list elements by the best coders in the world

showing results for - "write a java program to merge three singly linked list elements"
Ilyan
29 Aug 2019
1public 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(); } }
similar questions