Linked Lists are evil!

Well, I finally finished my second linked list assignment for computer science. So after the midterm last night that was dedicated and all the work I’ve done on them, I offically dispise them! 😛

wanna see what some of my lovely java my code looks like? ok, here you go:

StringList copy(int n, int m) //copies all the nth element starting at element m
{
StringList copycat = new StringList();
current = head;
int counta = 1;
boolean setup = false;
if (head != null)
{
while (current.next != null && setup == false) //sets up for next loop & makes first node
if (counta < m) { current = current.next; counta++; } else { setup = true; copycat.addLast(current.stringy); size++; copycat.current = head; } while (current.next != null) { int nop; for(nop = 0; nop != n && current.next != null; nop++) current = current.next; if (nop == n) copycat.addLast(current.stringy); if (nop != n) current.next = null; } } return copycat; } } it looks better when the tabs work, etc. :)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.