5/39
Part 1 of 7 · Nodes and costsLearn and do
A linked list has no index, so the k-th node is k steps from the head
A Python list jumps to any slot. A linked list has to walk there.
xs 0123431415
3head
→11 step
→42 steps
→13 steps
→5
→NoneReading the item at position n // 2, median of 5 runs:
Reading the middle item of a million-item linked list took 8.5 ms. About how long did xs[k] take on a Python list?
Pick an answer above to see the rest