[algogeeks] Re: Finding a single repeated element in an array

2007-08-18 Thread Vaibhav Jain
peeyush, take eg: n=6 array values: 10 20 30 40 50 50 in worst case, while loop which can increment 'i' can go upto n-1 and for loop (for 'j') every n-1 time check upto n times so total it becomes (n-1)*n= O(n*n). like this i think u can observe now.. On 8/18/07, Peeyush Bishnoi [EMAIL

[algogeeks] Re: Finding a single repeated element in an array

2007-08-18 Thread Peeyush Bishnoi
Hello All I thanxs Vaibhav to give feedback on my solution I am once again putting my solution back on this group. I welcome ur all valuale feedback on this... I can think this solution will work with constant space linear time incomparison to my previous solution which is n*n at worst