i am given an assignment to write code on interpolation search binary search(searching an integer in an ordered list). bt i dont have a clear idea about about both of them as i missed the theory class.so can anyone suggest me from where i can get satisfying information about them?
how to count comparison in binary search and interpolation search. is the number of comparison=number of iteration?or for binry search where we have two if conditions under the while loop ,the comparison will be 2*NUMBER OF ITERATION(one comparison for each if condition) or only one comparison for entering the while loop for once?
Every time the program makes a new guess at the answer, you should count one more comparison.
The number of if or else statements doesn't matter, unless a new guess is made, inside it.
In the binary loops I've seen, only one guess per iteration is made. Note that anyone could create a binary loop which made two guesses each iteration, but I have never seen that -- it's just a logical possibility.
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...