qsm_software
New member
- Joined
- Sep 13, 2006
- Messages
- 1
I have to do a Average Case Analysis for an algorithm that searches an integer K in an array.
Assume that every element in the n-element array shows up exactly twice (so there are n/2 distinct values, and each value occurs in two separate places in the array). Assume the array is unsorted (so the elements are 'randomly scattered' throughout the array).
I have to develop a formula for A(n), in terms of n and q(n is the number of elements in the array).
Thank you.
Assume that every element in the n-element array shows up exactly twice (so there are n/2 distinct values, and each value occurs in two separate places in the array). Assume the array is unsorted (so the elements are 'randomly scattered' throughout the array).
I have to develop a formula for A(n), in terms of n and q(n is the number of elements in the array).
Thank you.