Click here to Skip to main content
15,901,001 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Algorithm homework - Kruskal’s algorithm Pin
OriginalGriff12-Nov-19 23:44
mveOriginalGriff12-Nov-19 23:44 
QuestionAlgorithm homework Pin
Member 1465409212-Nov-19 23:41
Member 1465409212-Nov-19 23:41 
AnswerRe: Algorithm homework Pin
OriginalGriff12-Nov-19 23:43
mveOriginalGriff12-Nov-19 23:43 
QuestionHelp to draw recursive shape inside 2d array javascript Pin
Member 146476276-Nov-19 23:00
Member 146476276-Nov-19 23:00 
AnswerRe: Help to draw recursive shape inside 2d array javascript Pin
Richard MacCutchan6-Nov-19 23:24
mveRichard MacCutchan6-Nov-19 23:24 
Questionanyone know how to implement arden's theorem or the state removal method to convert an FA to a regex expression? Pin
honey the codewitch21-Sep-19 7:54
mvahoney the codewitch21-Sep-19 7:54 
QuestionHelp with algorithmic efficiency Pin
danirdd928-Sep-19 10:52
danirdd928-Sep-19 10:52 
AnswerRe: Help with algorithmic efficiency Pin
Richard Deeming10-Sep-19 1:22
mveRichard Deeming10-Sep-19 1:22 
Sounds like a simple maths problem. Smile | :)

To guarantee that the queue will be processed in time, you have to assume the worst-case scenario - that each Y takes TimeX2ms to process.

Therefore, the total time to process the queue will be:
TimeX2 * Count(Y) / Count(X)
You want that value to be less than or equal to the MaxTime, so:
MaxTime >= TimeX2 * Count(Y) / Count(X)
Count(X) >= TimeX2 * Count(Y) / MaxTime
Therefore, the minimum number of Xs required will be the ceiling of the number of Ys multiplied by the maximum time to process a Y divided by the maximum time allowed.

NB: If you were willing to accept that the queue might not be fully processed within the time limit, and you had more information about the distribution of processing times, then you might be able to bring that number down a bit. You could also consider an adaptive approach, where you increase or decrease the number of Xs over time based on the number of Ys waiting to be processed and the amount of time remaining.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Help with algorithmic efficiency Pin
danirdd9210-Sep-19 12:58
danirdd9210-Sep-19 12:58 
GeneralRe: Help with algorithmic efficiency Pin
Richard Deeming11-Sep-19 23:13
mveRichard Deeming11-Sep-19 23:13 
AnswerRe: Help with algorithmic efficiency Pin
Gerry Schmitz10-Sep-19 19:00
mveGerry Schmitz10-Sep-19 19:00 
GeneralRe: Help with algorithmic efficiency Pin
danirdd9210-Sep-19 22:19
danirdd9210-Sep-19 22:19 
GeneralRe: Help with algorithmic efficiency Pin
Gerry Schmitz11-Sep-19 16:36
mveGerry Schmitz11-Sep-19 16:36 
QuestionSorting algorithm faster than quick sort Pin
Shuji Kaya15-Aug-19 19:36
Shuji Kaya15-Aug-19 19:36 
AnswerRe: Sorting algorithm faster than quick sort Pin
OriginalGriff15-Aug-19 19:52
mveOriginalGriff15-Aug-19 19:52 
GeneralRe: Sorting algorithm faster than quick sort Pin
Shuji Kaya16-Aug-19 22:13
Shuji Kaya16-Aug-19 22:13 
GeneralRe: Sorting algorithm faster than quick sort Pin
OriginalGriff16-Aug-19 22:22
mveOriginalGriff16-Aug-19 22:22 
GeneralRe: Sorting algorithm faster than quick sort Pin
DaveAuld20-Aug-19 20:29
professionalDaveAuld20-Aug-19 20:29 
AnswerRe: Sorting algorithm faster than quick sort Pin
Shuji Kaya16-Aug-19 21:51
Shuji Kaya16-Aug-19 21:51 
QuestionBoruvka & Prim´s algorithm Pin
Mata Machalová13-Aug-19 2:43
Mata Machalová13-Aug-19 2:43 
AnswerRe: Boruvka & Prim´s algorithm Pin
Richard MacCutchan13-Aug-19 6:55
mveRichard MacCutchan13-Aug-19 6:55 
QuestionIf I have two algorithms, one has a running time of 100n^2 and the other has a run time of 2^n, what is the smallest value I can use to make 100n^2 run faster than 2^n? Pin
Matt_Booty18-Jul-19 8:00
Matt_Booty18-Jul-19 8:00 
AnswerRe: If I have two algorithms, one has a running time of 100n^2 and the other has a run time of 2^n, what is the smallest value I can use to make 100n^2 run faster than 2^n? Pin
Richard Deeming22-Jul-19 7:49
mveRichard Deeming22-Jul-19 7:49 
GeneralRe: If I have two algorithms, one has a running time of 100n^2 and the other has a run time of 2^n, what is the smallest value I can use to make 100n^2 run faster than 2^n? Pin
Matt_Booty22-Jul-19 8:34
Matt_Booty22-Jul-19 8:34 
QuestionTrying to program advanced Sudoku techniques Pin
haackeDc11-Jul-19 7:11
haackeDc11-Jul-19 7:11 

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.