Click here to Skip to main content
15,670,350 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionLALR vs LR parsing Pin
honey the codewitch13-Feb-20 3:53
mvahoney the codewitch13-Feb-20 3:53 
AnswerRe: LALR vs LR parsing Pin
Member 1298255823-Feb-20 6:45
Member 1298255823-Feb-20 6:45 
GeneralRe: LALR vs LR parsing Pin
honey the codewitch23-Feb-20 7:29
mvahoney the codewitch23-Feb-20 7:29 
QuestionRouting algorithm Pin
Rocks10028-Jan-20 8:23
Rocks10028-Jan-20 8:23 
AnswerRe: Routing algorithm Pin
Richard Deeming28-Jan-20 9:43
mveRichard Deeming28-Jan-20 9:43 
GeneralRe: Routing algorithm Pin
Rocks10028-Jan-20 10:11
Rocks10028-Jan-20 10:11 
GeneralRe: Routing algorithm Pin
Rocks10028-Jan-20 11:36
Rocks10028-Jan-20 11:36 
AnswerRe: Routing algorithm Pin
Gerry Schmitz29-Jan-20 3:34
mveGerry Schmitz29-Jan-20 3:34 
QuestionAnalysis of Algorithm Pin
Zain Shoukat Sadozai22-Jan-20 19:46
Zain Shoukat Sadozai22-Jan-20 19:46 
GeneralRe: Analysis of Algorithm Pin
Richard MacCutchan22-Jan-20 22:03
mveRichard MacCutchan22-Jan-20 22:03 
AnswerRe: Analysis of Algorithm Pin
phil.o22-Jan-20 23:04
mvephil.o22-Jan-20 23:04 
QuestionComputing FIRST and FOLLOW sets in LL(k) parse tables for k>1? I need resources Pin
honey the codewitch29-Dec-19 0:31
mvahoney the codewitch29-Dec-19 0:31 
QuestionFinding best knapsack solver Pin
Member 1469867123-Dec-19 23:42
Member 1469867123-Dec-19 23:42 
QuestionOptimal path searching question Pin
nameless reborn5-Dec-19 19:45
nameless reborn5-Dec-19 19:45 
AnswerRe: Optimal path searching question Pin
Patrice T7-Dec-19 6:45
mvePatrice T7-Dec-19 6:45 
AnswerRe: Optimal path searching question Pin
Gerry Schmitz7-Dec-19 7:47
mveGerry Schmitz7-Dec-19 7:47 
QuestionMaking a Class Schedule Using a Genetic Algorithm Pin
ali galavi3-Dec-19 1:10
ali galavi3-Dec-19 1:10 
AnswerRe: Making a Class Schedule Using a Genetic Algorithm Pin
Richard Deeming3-Dec-19 2:10
mveRichard Deeming3-Dec-19 2:10 
QuestionFind the best path Pin
Member 146753785-Dec-19 19:45
Member 146753785-Dec-19 19:45 
AnswerRe: Find the best path Pin
Patrice T2-Dec-19 12:28
mvePatrice T2-Dec-19 12:28 
AnswerRe: Find the best path Pin
Member 146753785-Dec-19 19:45
Member 146753785-Dec-19 19:45 
QuestionHelp w/ recursive algorithm Pin
Member 1466815525-Nov-19 16:03
Member 1466815525-Nov-19 16:03 
I recently messed up this question and I can't quite figure out how to solve it. With divide and conquer we can easily tell if the substrings are palindromes (and counting them alone would be easy). But we're not supposed to count them. The long string below should yield "3" as is has 3 levels of palindromes. Not wrapping my head around how to keep track of the rank when unwinding.

"yx xy yx xy yx xy yx xy" // -- not all are palindromes, so nothing here
"yxxy yxxy yxxy yxxy" // all 4 are palindromes - level 3
"yxxyyxxy yxxyyxxy" // both are palindromes - level 2
"yxxyyxxyyxxyyxxy" // whole string is palindrome - level 1

bool isPalindrome( const std::string& str ){
    // usual palindrome stuff
    //  If not, return false, else return true;
}

int palindromeCount( const std::string& str ) { 
    if ( !isPalindrome( str ) ) return 0;
    int l = palindromeCount( firstHalfofStr );
    int r = palindromeCount( secondHalfofStr );

    int x{0};
    if (l && r ) {
        // Do something w/ x here?
    }
    
    // how to get the proper level back I never figured out.
    // It can't be just 1 for each successful palindrome
    return 1 + x;
}

AnswerRe: Help w/ recursive algorithm Pin
Gerry Schmitz26-Nov-19 6:58
mveGerry Schmitz26-Nov-19 6:58 
GeneralRe: Help w/ recursive algorithm Pin
Member 1466815526-Nov-19 15:12
Member 1466815526-Nov-19 15:12 
QuestionAlgorithm homework - Kruskal’s algorithm Pin
Member 1465409212-Nov-19 23:41
Member 1465409212-Nov-19 23:41 

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.