0

Binary search of an array

I need help, I do not know how to form data structure I am asked to at my school. I need to do binary search on an array. User inputs length of an array and then the array itself and those values are considered to be valid keys for search. But, then the user enters number which determines how much times the other array has to be which will contain both valid and simingly valid keys which I suppose I have to program into the array to form the structure of "enlargened table". Length of that arrays is lenght of user entered array times the number I mentioned. There also has to be a vector which contains 1 for valid keys and 0 for ones that the programmer added to form enlargened table. I have no idea how to implement this. Please help me.

18th Oct 2019, 1:11 AM
Mladenka Orlić
Mladenka Orlić - avatar
2 RĂ©ponses
+ 2
Hello Mladenka Orlić , Firstly I'd like to apologize that I didn't come here with any suggestion or solution. I would like to help, but am finding it hard to understand the requirements even as you tried to explain it best you can. I was hoping, if possible, you could rephrase the task requirements to make it more easily comprehensible (I'm not native English speaker myself). Hopefully with better description of task requirements (probably with example case), you will get effective and efficient suggestions, hints or solution. And don't forget to share your work in progress (your attempt in code) to let people know how far you have gone through this, and where you are stuck. Good luck! 👍
18th Oct 2019, 3:49 AM
Ipang
+ 2
I have implemented Binary Search in C. I hope it might help https://code.sololearn.com/cDq97aTgNDwS/?ref=app
18th Oct 2019, 4:09 AM
Abhishek Tandon
Abhishek Tandon - avatar