正在加载图片...
上降充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Strategy 2:Binary Search The heart of the algorithm is a loop that looks at the middle element of the range,comparing it to the value x. If x is smaller than the middle item,high is moved so that the search is confined to the lower half. If x is larger than the middle item,1ow is moved to narrow the search to the upper half. 1414 Strategy 2: Binary Search • The heart of the algorithm is a loop that looks at the middle element of the range, comparing it to the value x. • If x is smaller than the middle item, high is moved so that the search is confined to the lower half. • If x is larger than the middle item, low is moved to narrow the search to the upper half
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有