Download presentation
Presentation is loading. Please wait.
Published byMontana Antill Modified over 10 years ago
1
1 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } AliceBobCarol null item next first
2
2 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } x AliceBobCarol null item next first
3
3 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } x AliceBobCarol null item next first
4
4 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. Alice x for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } AliceBobCarol null item next first
5
5 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. Alice for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } x AliceBobCarol null item next first
6
6 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. Alice for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } x AliceBobCarol null item next first
7
7 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. Alice Bob for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } x AliceBobCarol null item next first
8
8 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. Alice Bob for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } x AliceBobCarol null item next first
9
9 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. Alice Bob for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } x AliceBobCarol null item next first
10
10 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. Alice Bob Carol for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } x AliceBobCarol null item next first
11
11 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. Alice Bob Carol for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } x AliceBobCarol null item next first
12
12 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. Alice Bob Carol for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } x AliceBobCarol null item next first
13
13 Traversing a List Iteration. Idiom for traversing a null-terminated linked list. Alice Bob Carol for (Node x = first; x != null; x = x.next) { StdOut.println(x.item); } AliceBobCarol null item next first
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.