int (Node cur) { Node prev = null; int total = 0; while (cur != null) { if (cur.condition) { if (prev != null) { total += prev.x; } prev = cur; cur = cur.next; } else {<selection> if (prev != null) { total += prev.x; } prev = cur; cur = cur.next;</selection> return cur != null ? total + cur.x : total; } } return total; }