Click here to Skip to main content
15,881,380 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionLooking for "card playing" algorithm Pin
David Crow4-Jan-21 9:30
David Crow4-Jan-21 9:30 
AnswerRe: Looking for "card playing" algorithm Pin
Ralf Meier4-Jan-21 9:43
mveRalf Meier4-Jan-21 9:43 
AnswerRe: Looking for "card playing" algorithm Pin
Peter_in_27804-Jan-21 11:15
professionalPeter_in_27804-Jan-21 11:15 
GeneralRe: Looking for "card playing" algorithm Pin
jsc426-Jan-21 4:33
professionaljsc426-Jan-21 4:33 
GeneralRe: Looking for "card playing" algorithm Pin
Peter_in_27806-Jan-21 12:46
professionalPeter_in_27806-Jan-21 12:46 
AnswerRe: Looking for "card playing" algorithm Pin
Gerry Schmitz5-Jan-21 3:27
mveGerry Schmitz5-Jan-21 3:27 
Questionformulate an algorithm Pin
Member 1502086714-Dec-20 6:59
Member 1502086714-Dec-20 6:59 
AnswerRe: formulate an algorithm Pin
Greg Utas14-Dec-20 7:31
professionalGreg Utas14-Dec-20 7:31 
If you can figure out the last paragraph, you'll have a way to move an element into the correct position when it's out of place. That element might only be part way down the array, in which case you can move it up by only doing flips as far as that element, leaving the elements after it alone.

Start with an actual example, say 1235674. You want to move 4 up into the position currently occupied by 5. Clearly, 4 must be included in the first flip, else it'll never move. So flip(6) is the first operation, which yields 4765321. Now the ball is in your court.
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing.

AnswerRe: formulate an algorithm Pin
Gerry Schmitz14-Dec-20 11:37
mveGerry Schmitz14-Dec-20 11:37 
AnswerRe: formulate an algorithm Pin
Patrice T14-Dec-20 12:38
mvePatrice T14-Dec-20 12:38 
AnswerRe: formulate an algorithm Pin
Member 1525570320-Jun-21 20:01
Member 1525570320-Jun-21 20:01 
QuestionProblem in c language Pin
Member 150165689-Dec-20 3:16
Member 150165689-Dec-20 3:16 
AnswerRe: Problem in c language Pin
Richard Deeming9-Dec-20 3:43
mveRichard Deeming9-Dec-20 3:43 
AnswerRe: Problem in c language Pin
CHill609-Dec-20 3:44
mveCHill609-Dec-20 3:44 
AnswerRe: Problem in c language Pin
Serhii Oleksenko15-May-21 1:38
professionalSerhii Oleksenko15-May-21 1:38 
QuestionStamp circular trade Pin
Shir Gans29-Nov-20 6:25
Shir Gans29-Nov-20 6:25 
AnswerRe: Stamp circular trade Pin
Gerry Schmitz29-Nov-20 18:40
mveGerry Schmitz29-Nov-20 18:40 
AnswerRe: Stamp circular trade Pin
Mircea Neacsu6-Dec-20 5:45
Mircea Neacsu6-Dec-20 5:45 
GeneralRe: Stamp circular trade Pin
Shir Gans6-Dec-20 7:51
Shir Gans6-Dec-20 7:51 
QuestionGiven an array x, get the array y from a data set of arrays which has the smallest distance to x Pin
Member 1499380315-Nov-20 17:17
Member 1499380315-Nov-20 17:17 
QuestionCLOSED Pin
AlgoHelp13-Nov-20 23:31
AlgoHelp13-Nov-20 23:31 
AnswerRe: How to determine if 2 labelled graphs are identical? Pin
Greg Utas14-Nov-20 1:48
professionalGreg Utas14-Nov-20 1:48 
GeneralRe: How to determine if 2 labelled graphs are identical? Pin
Greg Utas14-Nov-20 3:04
professionalGreg Utas14-Nov-20 3:04 
GeneralCLOSED Pin
AlgoHelp14-Nov-20 3:49
AlgoHelp14-Nov-20 3:49 
GeneralRe: How to determine if 2 labelled graphs are identical? Pin
Greg Utas14-Nov-20 4:03
professionalGreg Utas14-Nov-20 4:03 

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.