Embercode
✕
References and MemoryQuick quiz

Cache locality

6 questions. Covers Cache locality in Python.

Questions 1 to 5 of 6

  1. 1. The timing program's largest run builds a linked list of 1,000,000 nodes in allocation order. How many nodes does sum_list visit when it walks that list once from the head?

    Type a number.

  2. 2. The array scan and the list walk both visit every value once. Which statement gives the right time complexity for each?
  3. 3. Why is the walk in shuffled order much slower than the walk in allocation order over the same number of nodes?
  4. 4. On most current desktop and server chips, what is the size of a cache line, and how many 4-byte array('i') items fit in one line?
  5. 5. The best_ms helper in the timing program runs the work five times and keeps the fastest time, so one slow run caused by background work does not change the reported time.

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.