this solution is wrong
On Wed, Feb 2, 2011 at 12:41 AM, bittu <shashank7andr...@gmail.com> wrote: > @ its again the question related to the frequency..of number > > My Approach would be > we have to count the no. of time the a particular number occurring in > the array then first took the number which has lowest frequency in > case of Tie FCFS used up. > then proceed to higher frequency number that represents the continuous > chunks so that how much elements this chunks it has we can remove this > in a single click & so on.... > > so for this 3 1 2 1 4 3 1 2 1 4 3 2 > > here array of 4 elements > Elements 1 2 3 4 ///also lets say we are initializing the array > index as 1 > Index 1 2 3 4 > Frequency 4 3 3 2 > > we first process the 4 Click Required 1 > then 2 Click Required 1 > then 3 Click Required 1 > then 1 Click Required 1 > > Total Click Required =4 > > > so It Can be done in O(n) while space O(n) is penalty we have to pay > for it...more better approach will be appreciated > > Correct me if you Find Approach is wrongs > > Thanks & Regrads > Shashank Mani ""The best way to escape from a problem is to solve 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 > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- SOURABH JAKHAR,(CSE)(3 year) ROOM NO 167 , TILAK,HOSTEL 'MNNIT ALLAHABAD The Law of Win says, "Let's not do it your way or my way; let's do it the best way." -- 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.