q2: Maintain a map it would solve the issue.
On Sat, Aug 6, 2011 at 12:28 PM, dilip makwana <dilipmakwa...@gmail.com>wrote: > FOR Q2> > > int i, j; > > > > /* new length of modified array */ > > > int NewLength = 1; > > > > for(i=1; i< Length; i++){ > > > > for(j=0; j< NewLength ; j++) > > > > { > > > > if(array[i] == array[j]) > > > > break; > > > > } > > > > /* if none of the values in index[0..j] of array is not same as array[i], > > > > then copy the current value to corresponding new position in array */ > > > > if (j==NewLength ) > > > > array[NewLength++] = array[i]; > > > } > > > On 6 August 2011 12:08, swetha rahul <swetharahu...@gmail.com> wrote: > >> Hi, >> >> Q.No:1 >> what is wrong here >> void foo(int x=10,int y) >> how compiler will treat it?? >> and what happen here >> void foo(int x=10,int y=20) >> >> Q.No:2 >> How to remove duplicate elements from an array in just one pass.. Take >> care of time and space complexity.. >> >> >> -- >> 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 >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > *Dilip Makwana* > VJTI > BTech Computers Engineering > 2009-2013 > > -- > 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 > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Thanks and regards, Raghavan.K.L <http://in.linkedin.com/in/raghavankl> -- 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 algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.