I doubt there is any solution better than O(n lg n). . .the max heap sounds good to me. On Nov 30, 1:15 am, "yogesh" <[EMAIL PROTECTED]> wrote: > On Nov 28, 10:27 pm, "Andre" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I was thinking to do something like this, but is it an efficient way to > > do it? > > Do you know any well know algorithm to do this kind of thing? > > > Thanks, > > > AndreU can use a maximum heap based on prority and > decrease priority after accesing maximum element > and then balance the heap . remove the elemnt after its priority > becomes zero > > If the range of priority is small then u can use > queues to each priority level. moving elemnts across ques after > accesing them. > > I m not aware of any well known algo. > please inform me if come across. > > Regds > Yogesh
--~--~---------~--~----~------------~-------~--~----~ 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-beta.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---