The code is the tested one. We are converting binary to num, not num to binary so i/10 is right.
I have spared my time and after testing i have given the code
cheers,
Ashish
On 6/21/06, anil kumar <[EMAIL PROTECTED]> wrote:
hi asish,
thanks for ur reply..
But ur code takes O(n logn) to find the missing integer.
The binaryToNum() will returns num in O(log n ) complexity.
And there is a small mistake in ur code is " it is not i =
i/10, it should be i = i/2 "
--
///\\
(@ @)
+----oOO----(_)-----------------------+
| ~~~ |
| Phone: +91(40)5511 1552 |
| ~~~ |
| Disclaimer: |
| The Statement and options |
| expressed here are my own |
| do not necessarily represent |
| those of Oracle Corp. |
+-----------------oOO-------------------+
|__|__|
|| ||
ooO Ooo
--~--~---------~--~----~------------~-------~--~----~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---
- [algogeeks] Find the missing integer anil kumar
- [algogeeks] Re: Find the missing integer Ashish Chugh
- [algogeeks] Re: Find the missing integer anil kumar
- [algogeeks] Re: Find the missing integer Ashish Chugh
- [algogeeks] Re: Find the missing intege... anil kumar
- [algogeeks] Re: Find the missing i... chaman
- [algogeeks] Re: Find the missi... anil kumar
- [algogeeks] Re: Find the missing integer varun_dale
- [algogeeks] Re: Find the missing integer anil kumar
- [algogeeks] Re: Find the missing integer Googmeister
- [algogeeks] Re: Find the missing integer [EMAIL PROTECTED]