可以进行两个n位大整数的乘法运算.PPT

可以进行两个n位大整数的乘法运算

* Exam4 Finding Minimum and Maximum(MaxMin) Background Find the lightest and heaviest of n elements using a balance that allows you to compare the weight of 2 elements. (对于一个具有 n 个元素的数组,用一个天平,通过比较 2个元素的重量,求出最轻和最重的一个) Goal Minimize the number of comparisons. (正确找出需要的元素,最少的比较次数?) * Exam4 Finding Minimum and Maximum(MaxMin) Obvious method(直接法) Find the max of n elements making n?1 comparisons. Find the min of the remaining n?1 elements making n?2 comparisons. Total number of comparisons is 2n?3. Max element Find element with max weight (重量) from w[0, n-1] Number of comparisons (比较次

文档评论(0)

1亿VIP精品文档

相关文档