Click here to Skip to main content
15,902,276 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: find the largest 1000 values Pin
George_George7-Nov-07 1:02
George_George7-Nov-07 1:02 
GeneralRe: find the largest 1000 values Pin
toxcct7-Nov-07 1:43
toxcct7-Nov-07 1:43 
GeneralRe: find the largest 1000 values Pin
toxcct7-Nov-07 1:45
toxcct7-Nov-07 1:45 
AnswerRe: find the largest 1000 values Pin
CPallini6-Nov-07 21:19
mveCPallini6-Nov-07 21:19 
GeneralRe: find the largest 1000 values Pin
George_George7-Nov-07 0:57
George_George7-Nov-07 0:57 
GeneralRe: find the largest 1000 values Pin
chandu0047-Nov-07 1:29
chandu0047-Nov-07 1:29 
GeneralRe: find the largest 1000 values Pin
George_George7-Nov-07 1:53
George_George7-Nov-07 1:53 
GeneralRe: find the largest 1000 values Pin
chandu0047-Nov-07 4:04
chandu0047-Nov-07 4:04 
here i have an idea. but not sure about the processing time complexities. we have to work them out practically and see.
George_George wrote:
memory can not hold all the data

thats true.
but i think that, memory can very well hold 1000 structures of the following type.
struct linkedlist
{
linkedlist * prev;
ULONG value;
linkedlist *next;
};
//the size comes here to be 4*3*1000(max)bytes.

1.define a linked list.
2.take care such that, when ever, any item is added into the linked list, and the count is >1000, delete the last one.
3.now, read each value from the list and insert it just in between the two values, of which, one is greater and the other is smaller.
4.in this case, at any point of time, the largest 1000 values will be handled by the linked list.

i hope, this algorithm is suitable for your application.
or if you fell that, iam wrong, please try to correct me.
thank you.
GeneralRe: find the largest 1000 values Pin
George_George7-Nov-07 4:16
George_George7-Nov-07 4:16 
GeneralRe: find the largest 1000 values Pin
chandu0047-Nov-07 5:04
chandu0047-Nov-07 5:04 
GeneralRe: find the largest 1000 values Pin
George_George7-Nov-07 17:08
George_George7-Nov-07 17:08 
GeneralRe: find the largest 1000 values Pin
Cyrilix7-Nov-07 18:42
Cyrilix7-Nov-07 18:42 
GeneralRe: find the largest 1000 values Pin
George_George7-Nov-07 19:04
George_George7-Nov-07 19:04 
GeneralRe: find the largest 1000 values Pin
chandu0048-Nov-07 1:52
chandu0048-Nov-07 1:52 
GeneralRe: find the largest 1000 values Pin
George_George8-Nov-07 4:00
George_George8-Nov-07 4:00 
QuestionRe: find the largest 1000 values Pin
David Crow7-Nov-07 4:55
David Crow7-Nov-07 4:55 
AnswerRe: find the largest 1000 values Pin
Cyrilix7-Nov-07 13:25
Cyrilix7-Nov-07 13:25 
GeneralRe: find the largest 1000 values Pin
George_George7-Nov-07 17:01
George_George7-Nov-07 17:01 
GeneralRe: find the largest 1000 values [modified] Pin
Cyrilix7-Nov-07 18:37
Cyrilix7-Nov-07 18:37 
GeneralRe: find the largest 1000 values Pin
George_George7-Nov-07 19:15
George_George7-Nov-07 19:15 
GeneralRe: find the largest 1000 values [modified] Pin
Cyrilix7-Nov-07 19:29
Cyrilix7-Nov-07 19:29 
GeneralRe: find the largest 1000 values Pin
George_George7-Nov-07 20:09
George_George7-Nov-07 20:09 
GeneralRe: find the largest 1000 values Pin
Cyrilix7-Nov-07 20:27
Cyrilix7-Nov-07 20:27 
GeneralRe: find the largest 1000 values Pin
George_George7-Nov-07 20:45
George_George7-Nov-07 20:45 
GeneralRe: find the largest 1000 values Pin
Cyrilix7-Nov-07 20:53
Cyrilix7-Nov-07 20:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.