home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / CH_04 / 244.jpg < prev    next >
Joint Photographic Experts Group Image  |  2013-12-11  |  699KB  |  2550x3300
Labels: book | crt screen | monitor | reckoner
OCR: 244 Chapter Arrays and Pointers The Linear Search example search many Many we applications might that require need might be searching stored for an in an array birthdays, array. to find ids an names element sizes in the in array. stock, For or other values this ment. One We algorithm can algorithm write each for the element searching algorithm of the for in an array the 19 element following inspected in an way: to array is see the if it is the Linear desired Search ele. Ir Given lement value CO search for Ini the irst index the ay loop while lesa than Compa ire to the ith ement the array they re equa return they are not equal increment 40u found, return Note that in the worst case (where Tis not in the array). the loop executed times On the average, the loop will be executed times. In both ...