Previous | Next --- Slide 18 of 50
Back to Lecture Thumbnails
fizzbuzz

Do we just throw away a_{8-15}?

potato

@fizzbuzz This example is doing exclusive scan, which means the first element in the result is 0 and the last element is a_{0-14}

cmchiang

This is similar to a Fenwick tree. If we use 1-index instead, the first stage is exactly doing add routine for each index i, and the second stage is a slight modification of doing sum routine for each index i. In fact, if we do not modify the second stage, we get an parallel algorithm with O(lg n) span and O(n) work for calculating inclusive scan.

Please log in to leave a comment.