Page 1 of 1

D. Binary Search(3152) Description Given an ordered sequence, you are required to do binary searching on it for some num

Posted: Mon May 09, 2022 6:28 am
by answerhappygod
D Binary Search 3152 Description Given An Ordered Sequence You Are Required To Do Binary Searching On It For Some Num 1
D Binary Search 3152 Description Given An Ordered Sequence You Are Required To Do Binary Searching On It For Some Num 1 (61.94 KiB) Viewed 37 times
C programming is the language
D. Binary Search(3152) Description Given an ordered sequence, you are required to do binary searching on it for some numbers. If found, print out this number, YES and comparison times. if not found, print out this number, NO and comparison times. Please refer to output samples. The data set maybe is as big as 10000. Input The first line enters several positive number(in ascending order), ended with -1. The second line enters several search numbers ended with -1. Output Print out the results in several lines. if the number is found, print out this number and its position based on 0, starting from ) if the number is not found, first print out the numbe and Not Found. There is space between the number, Not and Found words. Pls refer the output sample.
input 3 5 6 8 10 12 - 1 6 6 1 13 10 -1 output 162 1 Not Found 13 Not Found 10 4