Click here to Skip to main content
15,920,383 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Selecting values from list to make up totals in second list Pin
Wayne Gaylard15-May-17 22:34
professionalWayne Gaylard15-May-17 22:34 
AnswerRe: Selecting values from list to make up totals in second list Pin
F-ES Sitecore22-May-17 4:48
professionalF-ES Sitecore22-May-17 4:48 
QuestionALGORITHM EFFICIENCY/BIG O NOTATION Pin
Member 1313303117-Apr-17 1:29
Member 1313303117-Apr-17 1:29 
AnswerRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
OriginalGriff17-Apr-17 1:30
mveOriginalGriff17-Apr-17 1:30 
GeneralRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
Member 1313303117-Apr-17 1:59
Member 1313303117-Apr-17 1:59 
AnswerRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
Ralf Meier17-Apr-17 2:08
mveRalf Meier17-Apr-17 2:08 
AnswerRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
Gerry Schmitz17-Apr-17 7:15
mveGerry Schmitz17-Apr-17 7:15 
GeneralRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
Member 1313303118-Apr-17 1:27
Member 1313303118-Apr-17 1:27 
QuestionRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
Eddy Vluggen18-Apr-17 1:47
professionalEddy Vluggen18-Apr-17 1:47 
AnswerRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
Member 1313303118-Apr-17 1:53
Member 1313303118-Apr-17 1:53 
GeneralRe: ALGORITHM EFFICIENCY/BIG O NOTATION Pin
Eddy Vluggen18-Apr-17 3:54
professionalEddy Vluggen18-Apr-17 3:54 
Questionalgorithm method...??? Pin
9119110910-Apr-17 17:17
9119110910-Apr-17 17:17 
AnswerRe: algorithm method...??? Pin
Richard MacCutchan10-Apr-17 21:52
mveRichard MacCutchan10-Apr-17 21:52 
AnswerRe: algorithm method...??? Pin
Bernhard Hiller10-Apr-17 22:49
Bernhard Hiller10-Apr-17 22:49 
AnswerRe: algorithm method...??? Pin
Richard Deeming11-Apr-17 2:13
mveRichard Deeming11-Apr-17 2:13 
JokeRe: algorithm method...??? Pin
Peter_in_278011-Apr-17 3:34
professionalPeter_in_278011-Apr-17 3:34 
QuestionBinary tree Pin
Suman Ghosh22-Mar-17 0:40
Suman Ghosh22-Mar-17 0:40 
GeneralRe: Binary tree Pin
Ralf Meier22-Mar-17 2:22
mveRalf Meier22-Mar-17 2:22 
AnswerRe: Binary tree Pin
Alan Balkany22-May-17 4:09
Alan Balkany22-May-17 4:09 
QuestionWhat is the best/good sorting+pipelining strategy for my situation ? Pin
Member 1307259520-Mar-17 16:40
Member 1307259520-Mar-17 16:40 
To begin, I have the set of K values S={v_1, ..., v_K}. I want to pick the smallest value, replace it with another value, and again pick the smallest -- do this K times. So, initially, my best set B is empty, and I want to perform :

Step 1. Find minimum of S. Say it has index n. B=[B, v_n] (i.e., append v_n to B)

Step 2. Update S by replacing v_n with another value (not important how that other value is computed).

Repeat Steps 1 and 2 till B has K values.

I believe a reasonable way to do this is to first construct a min-heap from the initial S (KlogK complexity), and then I can (take out the root + insert new element) for (K-1) times. Assuming taking out root and insertion both are logK complexity, total complexity would be KlogK + 2(K-1)log(K) = (3K-2)logK.

As a next step, once I have the set B, I want to compute some function f(b) for each b in B, and repeat the above procedure with the set {f(b)} instead of the set S. In other words, taking the set {f(b)} as S now, I would like to perform the above described procedure. Brute force way -- I could first use up (3K-2)logK units of time to find B, then compute the set {f(b)}, and then use another (3K-2)logK units of time on {f(b)}. But, it is quite apparent I can do better by pipelining. Essentially, as soon as I start getting entries of B, I can compute f(.) for the available entries, and do some of the sorting operations.

Can you suggest a good/optimal way for the overall problem ?
Questionco-occurrence matrix Pin
Member 130454587-Mar-17 21:33
Member 130454587-Mar-17 21:33 
AnswerRe: co-occurrence matrix Pin
Richard MacCutchan7-Mar-17 23:09
mveRichard MacCutchan7-Mar-17 23:09 
AnswerRe: co-occurrence matrix Pin
Pete O'Hanlon7-Mar-17 23:19
mvePete O'Hanlon7-Mar-17 23:19 
GeneralRe: co-occurrence matrix Pin
Richard MacCutchan7-Mar-17 23:53
mveRichard MacCutchan7-Mar-17 23:53 
GeneralRe: co-occurrence matrix Pin
Pete O'Hanlon7-Mar-17 23:57
mvePete O'Hanlon7-Mar-17 23:57 

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.