CS210 · Lists · Annotated SlidesCircular Linked Lists and Iterators
Original
Overview

Circular Linked Lists and Iterators

Round-robin scheduling, circular linked lists with only a tail reference (rotate, add, remove), and the Iterator and Iterable interfaces.

How to read this page

Every original slide is shown unchanged. Yellow marks on a slide point to a numbered note: hover or tap a mark to jump to its note, and hover a note to see its marks. Questions tagged Past exam appeared on a real paper; Prediction questions are likely angles, not confirmed. Pick an answer to each question: a wrong pick tells you why it is wrong, so you can try again.

All 14 slides
  1. 1 Circular linked Lists
  2. 2 Round-Robin Scheduling
  3. 3 Round-Robin Scheduling
  4. 4 Circular Linked-Lists
  5. 5 Circular Linked-Lists
  6. 6 Circular Linked-Lists
  7. 7 Circular Linked-Lists: rotate
  8. 8 Circular Linked-lists:
  9. 9 tail
  10. 10 one
  11. 11 Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser, Wiley, 2014
  12. 12 Iterators
  13. 13 The Iterable Interface
  14. 14 The for-each Loop
Slide 1 / 14

Circular linked Lists

Slide 1: Circular linked Lists
Slide 2 / 14

Round-Robin Scheduling

Slide 2: Round-Robin Scheduling

Notes

  1. Round-robin scheduling: each process gets a time slice, then goes to the back.

Slide 3 / 14

Round-Robin Scheduling

Slide 3: Round-Robin Scheduling
Slide 4 / 14

Circular Linked-Lists

Slide 4: Circular Linked-Lists

Exam angle

PredictionQ1

In a circular singly linked list with a tail reference, the head is:

Slide 5 / 14

Circular Linked-Lists

Slide 5: Circular Linked-Lists
Slide 6 / 14

Circular Linked-Lists

Slide 6: Circular Linked-Lists
Slide 7 / 14

Circular Linked-Lists: rotate

Slide 7: Circular Linked-Lists: rotate

Notes

  1. rotate(): tail = tail.next moves the first element to the back in O(1).

Slide 8 / 14

Circular Linked-lists:

Slide 8: Circular Linked-lists:
Slide 9 / 14

tail

Slide 9: tail
Slide 10 / 14

one

Slide 10: one
Slide 11 / 14

Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser, Wiley, 2014

Slide 11: Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser, Wiley, 2014
Slide 12 / 14

Iterators

Slide 12: Iterators
Slide 13 / 14

The Iterable Interface

Slide 13: The Iterable Interface

Notes

  1. Iterable has iterator(); for-each works on any Iterable.

Slide 14 / 14

The for-each Loop

Slide 14: The for-each Loop