Import Java. io. bufferedreader; import Java. io. ioexception; import Java. io. inputstreamreader; import Java. util. category; Class dnode {public int score =-1; Public dnode llink; Public dnode rlink;} class doublelist {static dnode pre, PTR, Head, current; doublelist () {PTR = new dnode (); PTR. llink = PTR; PTR. rlink = PTR; head = PTR;} public static void insert (dnode PTR) {dnode first = head. rlink; PTR. rlink = head. rlink; PTR. llink = head; H EAD. rlink = PTR; first. llink = PTR;} public static void Delete (dnode PTR) {PTR. llink. rlink = PTR. rlink; PTR. rlink. llink = PTR. llink; PTR = NULL;} public static void modify (dnode PTR, int m) {PTR. score = m;} public static int length () {current = head. rlink; int COUNT = 0; while (current. rlink! = Head) {current = current. rlink; count ++;} return count ;}} public class main {public static void main (string [] ARGs) throws ioexception {doublelist doublist = new doublelist (); printdoublelist (doublist); // outputs the current bidirectional linked list; optional SC = new (New bufferedreader (New inputstreamreader (system. in); While (true) {system. out. println ("1. insert 2. delete 3. modify "); system. out. println ("Enter the operation number to be selected:"); int select = SC. nextint (); If (select = 1) {Insertopp (doublist);} If (select = 2) {deleteopp (doublist);} If (select = 3) {modifyopp (doublist);} system. out. println () ;}} public static void insertopp (doublelist doublist) {// insert operation system. out. println ("Enter the node to be inserted:"); then SC = new second (New bufferedreader (New inputstreamreader (system. in); int A = SC. nextint (); While (! = 0) {dnode node = new dnode (); node. score = A; doublist. insert (node); A = SC. nextint ();} printdoublelist (doublist);} public static void deleteopp (doublelist doublist) {// Delete the system. out. println ("Enter the serial number of the node to be deleted:"); then SC = new second (New bufferedreader (New inputstreamreader (system. in); int COUNT = SC. nextint (); dnode current = doublist. head; For (INT I = 1; I <= count; I ++) {current = current. rlink;} doublist. delete (current); P Rintdoublelist (doublist);} public static void modifyopp (doublelist doublist) {// modify the system. out. println ("Enter the serial number of the node to be modified:"); then SC = new second (New bufferedreader (New inputstreamreader (system. in); int COUNT = SC. nextint (); dnode current = doublist. head; For (INT I = 1; I <= count; I ++) {current = current. rlink;} system. out. println ("Enter the value to be modified:"); int n = SC. nextint (); doublist. modify (current, n); printdoublelist (doublist );} Public static void printdoublelist (doublelist doublist) {system. out. println ("two-way linked list:"); system. out. print ("head" + "<->"); If (doublist. head. rlink! = Doublist. Head) {dnode current = doublist. Head. rlink; int COUNT = 0; while (current. rlink! = Doublist. head) {system. out. print (current. score + "<->"); current = current. rlink;} system. out. print (current. score);} system. out. println ();}}