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.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)