![]() |
|
[Java] Circular Linked Lists - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Java] Circular Linked Lists (/showthread.php?tid=5760832) |
Circular Linked Lists - JakeDarkblade - Nov 30, 2017 This is the code i've come up with to return a String containing the items of all the nodes in the list separated by commas. But this code doesn't work with a linked list that is circular that connects back to the head node. RE: Circular Linked Lists - GoodVibes - Nov 30, 2017 i really wish i could help you, but unfortunately i don't know much about programming or java in general. good luck in figuring this out though. wow. ok, so what i would do is on the second current!=null check i'd also checck if currentl also doesn't equal head so like Code if(current != null && !current.equals(head))that should do it for you friend. only wrote out all that code bc i'm guessing your new bc this was relatively simple problem, i'm just very coked out right now so i hope this helps. cheers. RE: Circular Linked Lists - JakeDarkblade - Nov 30, 2017 (Nov 30, 2017 05:56 PM)GoodVibes Wrote: i really wish i could help you, but unfortunately i don't know much about programming or java in general. Thanks for that brother and yeah i'm new RE: Circular Linked Lists - Sheeple - Nov 30, 2017 omg I just started learning linked listss in class mind blown I need help on my HW but my professor didn't provide me a main.java even tho it says he did and to use it to write the code soooooooooooooooooooooooooooooo RE: Circular Linked Lists - GenericSkid - Nov 30, 2017 Its not really a hard concept to understand: ![]() In this picture we have two instances of Node. The class node looks like this: PHP Code To construct a list of a single element: PHP Code Now if we want a list of two elements: PHP Code Obviously you will not want to do this manually so you would have methods for adding to the list (and handling edge cases). But as long as the links follow the pattern in the image above you have yourself a circular linked list. RE: Circular Linked Lists - matt - Dec 1, 2017 Check out my latest post in the same subforum I just talked about doubly circular linked lists and you may use it for REFERENCE If this is for school I do NOT give you permission to use this however you may study it and take concepts from it to create your own material RE: Circular Linked Lists - GoodVibes - Dec 1, 2017 (Dec 1, 2017 06:26 AM)Midnight Blue™ Wrote: Check out my latest post in the same subforum I just talked about doubly circular linked lists and you may use it for REFERENCE hi,you can call me young turbo no one cares if u give permission or not if u put it on the internet and he wants to steal it he will lol god blessings, xoxo young turbo RE: Circular Linked Lists - JakeDarkblade - Dec 1, 2017 (Dec 1, 2017 06:26 AM)Midnight Blue™ Wrote: Check out my latest post in the same subforum I just talked about doubly circular linked lists and you may use it for REFERENCE Thanks brother I’ll have a look later. RE: Circular Linked Lists - matt - Dec 1, 2017 (Dec 1, 2017 01:08 PM)GoodVibes Wrote: hi,you can call me young turbo His fault if he gets caught cheating, lots of algorithms now a days that check for plagiarized work. |