Advertisement

01.02.2008 at 09:07PM PST, ID: 23054882
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Efficient algorithm for finding Max k

Tags: Efficient algorithm, finding Max k, incremental
Hi,

I have a hash table of <key,value> pairs. I process input and keep on updating the values associated with the keys. Values always increase ... they are never decremented. I need to keep track of max k values in the hash table.

I need an efficient algorithm - speed is a concern, memory is not ... I am okay with having to maintain an array of k pointers.

For example

Input:                                               hash table                                                                               top 2
<10,60>                                          <10,60>                                                                                   <10,60>, NULL
<12,123>                                        <10,60>,<12,123>                                                                  <12,123>,<10,60>
<36,99>                                          <10,60>,<12,123>,<36,99>                                                    <12,123>,<36,99>
<5,88>                                            <10,60>,<12,123>,<36,99>,<5,88>                                        <12,123>,<36,99>
<10,29>                                          <10,89>,<12,123>,<36,99>,<5,88>                                        <12,123>,<36,99>
<11,200>                                        <10,89>,<12,123>,<36,99>,<5,88>,<11,200>                       <11,200>,<12,123>
<10,100>                                        <10,189>,<12,123>,<36,99>,<5,88>,<11,200>                      <11,200>,<10,189>
<10,51>                                        <10,189>,<12,123>,<36,99>,<5,88>,<11,200>                        <10,240>,<11,200> [notice the order]

I shall be implementing the algorithm in C.
Ordering of elements in the top k elements is important ... I need them in ascending order. Value of k is not known in advance.

Thanks!!!
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: sunnycoder
Solution Provided By: ozo
Participating Experts: 4
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
01.02.2008 at 09:51PM PST, ID: 20570913

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.02.2008 at 10:31PM PST, ID: 20571045

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.02.2008 at 10:49PM PST, ID: 20571082

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.02.2008 at 11:09PM PST, ID: 20571128

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.02.2008 at 11:17PM PST, ID: 20571151

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.02.2008 at 11:24PM PST, ID: 20571174

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.02.2008 at 11:26PM PST, ID: 20571183

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.02.2008 at 11:33PM PST, ID: 20571204

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.02.2008 at 11:35PM PST, ID: 20571207

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.02.2008 at 11:36PM PST, ID: 20571211

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.02.2008 at 11:41PM PST, ID: 20571224

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.02.2008 at 11:48PM PST, ID: 20571243

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:05AM PST, ID: 20571276

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:09AM PST, ID: 20571283

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:12AM PST, ID: 20571291

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:15AM PST, ID: 20571299

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:17AM PST, ID: 20571303

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:21AM PST, ID: 20571315

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:24AM PST, ID: 20571323

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:26AM PST, ID: 20571328

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:31AM PST, ID: 20571345

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:31AM PST, ID: 20571350

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:33AM PST, ID: 20571358

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:34AM PST, ID: 20571364

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:36AM PST, ID: 20571368

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:38AM PST, ID: 20571380

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:44AM PST, ID: 20571398

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:45AM PST, ID: 20571403

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 12:59AM PST, ID: 20571460

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 01:01AM PST, ID: 20571463

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 01:27AM PST, ID: 20571547

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.03.2008 at 07:00AM PST, ID: 20573253

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.21.2008 at 05:25AM PDT, ID: 21400858

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628