Click here to Skip to main content
15,511,274 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionMy implementation of Eratosthenes sieve is horribly slow. But why? Pin
Member 149328737-Sep-20 23:00
Member 149328737-Sep-20 23:00 
AnswerRe: My implementation of Eratosthenes sieve is horribly slow. But why? Pin
Richard MacCutchan7-Sep-20 23:38
mveRichard MacCutchan7-Sep-20 23:38 
GeneralRe: My implementation of Eratosthenes sieve is horribly slow. But why? Pin
Richard Deeming8-Sep-20 0:59
mveRichard Deeming8-Sep-20 0:59 
AnswerRe: My implementation of Eratosthenes sieve is horribly slow. But why? Pin
Dave Kreskowiak8-Sep-20 7:46
mveDave Kreskowiak8-Sep-20 7:46 
GeneralRe: My implementation of Eratosthenes sieve is horribly slow. But why? Pin
Richard Andrew x6422-Sep-20 11:36
professionalRichard Andrew x6422-Sep-20 11:36 
GeneralRe: My implementation of Eratosthenes sieve is horribly slow. But why? Pin
Dave Kreskowiak22-Sep-20 17:25
mveDave Kreskowiak22-Sep-20 17:25 
AnswerRe: My implementation of Eratosthenes sieve is horribly slow. But why? Pin
Patrice T18-Sep-20 20:51
mvePatrice T18-Sep-20 20:51 
QuestionHow can I remove alternate words from a sentence? Pin
maicart5-Sep-20 23:27
maicart5-Sep-20 23:27 
I'm building a language learning website. In one of the exercises the user has to guess the missing words. For example in the sentence:

What is the weather like? It is sunny today.

My developer has created an algorithm that shows the first and last words of the sentence, while removing the alternate words within it. The result is:

What ____ the ____ like? ____ is ____ today.

However, in a sentence like this:

It is not the entrance, it is the exit.

My developer says that the algorithm does not work because the word "the" is repeated.

I don't understand why the algorithm does not work when words are repeated. They still appear in alternate position, right?

Is there a solution? I could post our current algorithm if necessary.
AnswerRe: How can I remove alternate words from a sentence? Pin
Gerry Schmitz6-Sep-20 5:14
mveGerry Schmitz6-Sep-20 5:14 
GeneralRe: How can I remove alternate words from a sentence? Pin
Richard MacCutchan6-Sep-20 7:13
mveRichard MacCutchan6-Sep-20 7:13 
GeneralRe: How can I remove alternate words from a sentence? Pin
Gerry Schmitz6-Sep-20 7:33
mveGerry Schmitz6-Sep-20 7:33 
AnswerRe: How can I remove alternate words from a sentence? Pin
Richard MacCutchan6-Sep-20 5:52
mveRichard MacCutchan6-Sep-20 5:52 
GeneralRe: How can I remove alternate words from a sentence? Pin
maicart6-Sep-20 7:23
maicart6-Sep-20 7:23 
GeneralRe: How can I remove alternate words from a sentence? Pin
Richard MacCutchan6-Sep-20 7:41
mveRichard MacCutchan6-Sep-20 7:41 
GeneralRe: How can I remove alternate words from a sentence? Pin
Richard Andrew x646-Sep-20 9:04
professionalRichard Andrew x646-Sep-20 9:04 
GeneralRe: How can I remove alternate words from a sentence? Pin
maicart7-Sep-20 2:27
maicart7-Sep-20 2:27 
GeneralRe: How can I remove alternate words from a sentence? Pin
Richard MacCutchan7-Sep-20 2:38
mveRichard MacCutchan7-Sep-20 2:38 
Questionalgorithm to place N rectilinear blocks in a ring to minimize total area Pin
rbuchana14-Aug-20 6:21
rbuchana14-Aug-20 6:21 
GeneralRe: algorithm to place N rectilinear blocks in a ring to minimize total area Pin
harold aptroot14-Aug-20 9:04
harold aptroot14-Aug-20 9:04 
GeneralRe: algorithm to place N rectilinear blocks in a ring to minimize total area Pin
rbuchana14-Aug-20 9:19
rbuchana14-Aug-20 9:19 
AnswerRe: algorithm to place N rectilinear blocks in a ring to minimize total area Pin
Gerry Schmitz14-Aug-20 9:22
mveGerry Schmitz14-Aug-20 9:22 
AnswerRe: algorithm to place N rectilinear blocks in a ring to minimize total area Pin
Greg Utas14-Aug-20 9:52
mveGreg Utas14-Aug-20 9:52 
GeneralRe: algorithm to place N rectilinear blocks in a ring to minimize total area Pin
rbuchana15-Aug-20 10:00
rbuchana15-Aug-20 10:00 
GeneralRe: algorithm to place N rectilinear blocks in a ring to minimize total area Pin
Greg Utas15-Aug-20 10:36
mveGreg Utas15-Aug-20 10:36 
GeneralRe: algorithm to place N rectilinear blocks in a ring to minimize total area Pin
Greg Utas15-Aug-20 10:45
mveGreg Utas15-Aug-20 10:45 

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.