// The structure of the linked list class using list {int data; using list next ;} /***** merge two sorted linked lists **/public class UnionLinkList {/***** create a single-chain table * @ param head single-chain header node */public void createLinkedList (sorted list head) {empty list cur = head; empty tables = new tables (System. in); String data; System. out. println ("Enter the value of the single-link table node, input # End"); while (true) {data = complete. next (); if (data. equals ("#") {cur. next = null; break;} vertex list node = new Vertex list (); node. data = Integer. valueOf (data); cur. next = node; cur = cur. next ;}} /***** @ param a linked list a * @ param B linked list B * @ param union merged linked list * @ return merged linked list */public outer list union (except list, except List B, except list union) {except list pc = union = a; except list pa =. next; sort list pb = B. next; while (pa! = Null & pb! = Null) {if (pa. data <pb. data) {pc. next = pa; pc = pa; pa = pa. next;} else {pc. next = pb; pc = pb; pb = pb. next;} if (pa! = Null) {pc. next = pa;} if (pb! = Null) {pc. next = pb;} return union;}/*** print a single-chain table * @ param head pointer */public void printLinkList (empty list head) {if (head = null | head. next = null) {return;} head = head. next; while (head! = Null) {System. out. print (head. data + ""); head = head. next;} System. out. println ();} public static void main (String [] args) {UnionLinkList ull = new UnionLinkList (); physical list pa = new physical list (); physical list pb = new physical list (); ull. createLinkedList (pa); ull. createLinkedList (pb); distinct list union = null; union = ull. union (pa, pb, union); ull. printLinkList (union );}}