Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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