Question: 1)Given an array of x integers between 0 and y, how many of these numbers are between an arbitrary interval i and k in constant
1)Given an array of x integers between 0 and y, how many of these numbers are between an arbitrary interval i and k in constant time?
Example, given array is 6,2,3,9, 12, 48, 100, -199, 32, 23, 8, 20, 19, 17, 18, 77 you want to compute how many numbers are between 11 and 23.
Answer must be in constant time, explain it and design an algorithm for it in c++, please post picture of output
Describe another algorithm that is time complexity , ensure code is in c++ and has time complexity for each part and as a whole, please post picture of output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
