{"title":"Analytic derivation of comparisons in binary search","authors":"T. Rolfe","doi":"10.1145/289251.289255","DOIUrl":null,"url":null,"abstract":"Numerous authors of programming texts and algorithms / data structures texts develop code for the binary search. The common implementation is one in which the loop contains two comparisons for three outcomes --- the key is to the left of the midpoint, to the right of the midpoint, or exactly at the midpoint --- Implementation A below.","PeriodicalId":177516,"journal":{"name":"ACM Signum Newsletter","volume":"30 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1997-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"ACM Signum Newsletter","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/289251.289255","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3
Abstract
Numerous authors of programming texts and algorithms / data structures texts develop code for the binary search. The common implementation is one in which the loop contains two comparisons for three outcomes --- the key is to the left of the midpoint, to the right of the midpoint, or exactly at the midpoint --- Implementation A below.