Hi, please help me solve this problem. It's something like that: given
an array A[1...n] filled with different integers in range [1...n],
find a missing number. The only operation which you can use is
get_ith_bit_from_pos_n(i, n) = i'th bit of A[n]. This can be solved in
O(n) time. But how?
Is this extracting i'th bit from a[X] or just extracting Integer from i
th index of an array???
if its the later, then get the number and sum up by using OR
operation not sure:-)
then subtract it from n(n+1)/2=missing Number
--~--~-~--~~~---~--~~
You
extract(i, n) - i'th bit from position n in an array A - i'th bit of A[n]
On 11/17/06, Idris [EMAIL PROTECTED] wrote:
Is this extracting i'th bit from a[X] or just extracting Integer from i
th index of an array???
if its the later, then get the number and sum up by using OR
operation
yes, this one was copy/pasted from :
http://groups.google.com/group/algogeeks/browse_thread/thread/8b9ed1060e275f29/a797db6ebd94035f?lnk=stq=minimal+path+sumrnum=1#a797db6ebd94035f
as i noticed noone seen it :)
Hello,
first of all, thanks to all for help!
as Lego Haryanto alredy guessed, this
Hi,
I have an array in which elements are present .
The number of elements n = 10^6 .
Now if i delete an element in the array, i want to update the
array by moving all the elements to the left. It is very slow
considering the size of element and i want to access the array
with new updated
search for maximum subsequence problem. urs is a special case of that.
On 11/16/06, Idris [EMAIL PROTECTED] wrote:
You can use N space.:-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
Arun wrote:
On 11/17/06, Nik [EMAIL PROTECTED] wrote:
Hi,
I have an array in which elements are present .
The number of elements n = 10^6 .
Now if i delete an element in the array, i want to update the
array by moving all the elements to the left. It is very slow
considering
1) Scan through the array counting number of 0s and 1s in MSB, as well as
separating the 0s into an array arr0 and 1s into an array arr1 (if you do
not want to use extra space you can use splitting around pivot pass of
quicksort).
2) You would know how many 0s and 1s should be present in MSB for
can u pls explain it?:-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to
sorry it sum note some:-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL
neat solution :)
On 11/17/06, Dhyanesh (ધયાનેશ) [EMAIL PROTECTED] wrote:
1) Scan through the array counting number of 0s and 1s in MSB, as well as
separating the 0s into an array arr0 and 1s into an array arr1 (if you do
not want to use extra space you can use splitting around pivot pass of
11 matches
Mail list logo