//there is an array of size N in which every number is between 1 and N , determine if there are any duplicates in it.
// I'll try to do it in O(N) w/o using any additional memory. the key is to use content of the array as index into array.
// checking in O(1) if that number has been seen already.
some difficult one's
Started by dixiragh, Jan 01 2010 02:17 PM
2 replies to this topic
#1
Posted 01 January 2010 - 02:17 PM
|
|
|
#2
Posted 01 January 2010 - 04:08 PM
Given that this is homework, what is your question about it?
#3
Posted 25 March 2010 - 05:05 AM
Forum != PrivateTutor
While( !User.hasAnswer )
{
User.askQuestion();
if( User.postCode && User.putForthEffort )
{
CodeCallMembers.Help();
User.hasAnswer = true;
}
else
{
CodeCallMembers.Laugh();
}
}
-CDG10620
Software Developer
Software Developer


Sign In
Create Account

Back to top









