正在加载图片...
Linear search performance r We analyze the successful and unsuccessful searches separately. We count how many times the search value is compared against the array elements r Successful Search o Best Case-1 comparison o Worst Case-N comparisons(N-array size) r Unsuccessful search Best case Worst Case-N comparisons C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 10-6© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 10 - 6 Linear Search Performance We analyze the successful and unsuccessful searches separately. We count how many times the search value is compared against the array elements. Successful Search Best Case – 1 comparison Worst Case – N comparisons (N – array size) Unsuccessful Search Best Case = Worst Case – N comparisons
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有