Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Circular Linked List Lab 04 Circular Linked List Objective: W nte a class called GenCir lilar ink ell ist Isch 'sa gese e ea

Java Circular Linked List

image text in transcribed

Lab 04 Circular Linked List Objective: W nte a class called GenCir lilar ink ell ist Isch 'sa gese e ea cular linked st This Ink last is sitanlar tot i@ s'agle i n ce l srd t was com i a c ass except the asr element's lapents to the fiest elera st lacs er w rls tbetail pants to e hea The claas CenCircularLinkedList neods to have the tollowiag e Internal ckass I.ist Node which a Lustnaco Variables - link of typc LisNodo Instaue Variables o headetype ListNode which always peints to the he of the linkel list o curnwut of type ListNode whicb movea aronnd poiing to on of the uodes o previs of type ListNode which is one element behind the current tail of type ListNodo which is to last lement in the list that's linic points to lead Construclor A default coastmctor dat initializes head to a" empty ListNode and sets curent to point at the Load. . Methords goToNext-This moves curlett Dode foraed utle list by one ode. o goToPrev-This moves the current mode backnards in the list by one node, o getDataAtCurrent-retums the data at the curent node as long as the cureB't mill o setDataAtCarrent-takes in a parameter and sels the data at the euet node to that value as leg as curetistotll o inserThis createsewLisNode aad adds i afte the tai, Keep ia mid th list nst main eireula insertNo.le A RerCurrent creates a new ist vode bbsed ca d atat sat is assed in by s a meter and puts t ni t o t a er the currect postbou et ) u mu d tat i sbe cutren, no ts er ead or tad you Deec to ma sure to sett xt proper in s correct o deleteCurreutNode -es the euereat node tiom the list by sosotting tho linls, Eeop ia ndati the ceu aodo is eitho the head or tail thea thore's so sgocial stops that usbe perfomed showList-prins out the contents of the lis, line-by-line inList-letras a true o.. false value based on whetheLOE LOt the daca passed i via a parunetes is in the list Fially wite a class that tests the fuactioaality of a ciucular liaked ist

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

ISBN: 0201844524, 978-0201844528

Students also viewed these Databases questions