正在加载图片...
An Inclusive Scan Application Example Assume that we have a 100-inch sandwich to feed 10 people We know how much each person wants in inches -[35272843081] How do we cut the sandwich quickly? How much will be left? Method 1:cut the sections sequentially:3 inches first,5 inches second,2 inches third,etc. Method 2:calculate prefix sum: -[3,8,10,17,45,49,52,52,60,61](39 inches left) 电子科妓女学 O5 An Inclusive Scan Application Example – Assume that we have a 100-inch sandwich to feed 10 people – We know how much each person wants in inches – [3 5 2 7 28 4 3 0 8 1] – How do we cut the sandwich quickly? – How much will be left? – Method 1: cut the sections sequentially: 3 inches first, 5 inches second, 2 inches third, etc. – Method 2: calculate prefix sum: – [3, 8, 10, 17, 45, 49, 52, 52, 60, 61] (39 inches left) 5
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有