Slide 1

Slide 1 text

Linked Lists Week 4

Slide 2

Slide 2 text

How was HackerRank?

Slide 3

Slide 3 text

Confusions / common problems with Linked Lists?

Slide 4

Slide 4 text

Linked List Tips and Tricks

Slide 5

Slide 5 text

Linked List Tips and Tricks Take multiple passes through the linked list
 - get length 
 - save other information about contents Two pointers
 - ‘race car’ strategy with one regular pointer, and one fast pointer Dummy node
 - helpful for preventing errors when returning ‘head’

Slide 6

Slide 6 text

Understand Match Pseudocode / Plan Implement Review Evaluate

Slide 7

Slide 7 text

Understand Match Pseudocode / Plan Implement Review Evaluate

Slide 8

Slide 8 text

Reverse Linked List Understand -> Match -> Plan -> Implement

Slide 9

Slide 9 text

In class exercise Understand -> Match -> Plan -> Implement

Slide 10

Slide 10 text

In class exercise Understand -> Match -> Plan -> Implement Try to spend ~15 minutes on a problem

Slide 11

Slide 11 text

In class exercise Understand -> Match -> Plan -> Implement Try to spend ~15 minutes on a problem Goal for each problem is to have it pass a simple test case