Skip to content

Instantly share code, notes, and snippets.

@klaeufer
Created October 20, 2011 18:05
Show Gist options
  • Save klaeufer/1301827 to your computer and use it in GitHub Desktop.
Save klaeufer/1301827 to your computer and use it in GitHub Desktop.
Loyola University Chicago Comp 373/473 Project 2a Sample Test Case 3
struct ListNode { value, next };
var n;
var h;
var s;
n = new ListNode;
h = n;
n.value = 2;
n.next = new ListNode;
n = n.next;
n.value = 3;
n.next = new ListNode;
n = n.next;
n.value = 5;
n.next = new ListNode;
n = n.next;
n.value = 7;
n.next = 0;
n = h;
while (n) {
s = s + n.value,
n = n.next
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment