Michael Wijaya
Reputation
1,387
Next privilege 2,000 Rep.
 Jul3 answered Convert head Times to List Jun28 comment Mathematica for Computer Scientists Gray's "Mastering Mathematica" has a nice chapter on rule-based programming followed by a discussion of substitution and Lambda calculus, so you may want to check that out. Jun18 accepted Implementing a function which generalizes the merging step in merge sort Jun18 comment Implementing a function which generalizes the merging step in merge sort I am still developing my feel for efficient programs, so it helps to look at other implementations even if they are not the fastest possible. Leonid's commentary also adds value to your answer. +1 Jun17 awarded Nice Question Jun17 comment Implementing a function which generalizes the merging step in merge sort I think I know what is going on now. There is some caching going on in the previous section, thus the comment on clearMergeJITCache. Jun17 comment Implementing a function which generalizes the merging step in merge sort You evaluated mergeList[huge1,huge2,Less,CompileToC -> True]//Short//AbsoluteTiming twice at the beginning of the Benchmarks section, but the timing results are significantly different. Am I missing something here? Jun17 comment Implementing a function which generalizes the merging step in merge sort The difference in performance is astounding: 0.12s vs 1.23s for lists of lengths 10000 and 1.13s vs 146.60s for lists of length 100000. I find it reassuring that even without making significant changes to the straightforward recursion, I can get major performance boost by switching to linked lists. Perhaps reading The Little Schemer did not cause too much harm. Jun17 revised Implementing a function which generalizes the merging step in merge sort Added sample output Jun17 comment Implementing a function which generalizes the merging step in merge sort @Rojo Thanks for pointing out the ambiguity. I edited the question. Jun17 revised Implementing a function which generalizes the merging step in merge sort Added clarification in response to question by Rojo Jun17 comment Implementing a function which generalizes the merging step in merge sort @Rojo For MergeList, the two lists need not be sorted. For example, MergeList[{2, 5, 1}, {3, 4}, LessEqual] evaluates to {2, 3, 4, 5, 1}. Jun17 asked Implementing a function which generalizes the merging step in merge sort Jun16 awarded Autobiographer Jun15 comment How to substitute numeric values in a symbolic Jacobian matrix? +1 for explaining what went wrong in M.J.'s code and the use of ArrayRules + ArrayPlot. Jun15 revised How to substitute numeric values in a symbolic Jacobian matrix? deleted 395 characters in body Jun15 revised How to substitute numeric values in a symbolic Jacobian matrix? Updated following M.J.'s comments Jun14 comment How to substitute numeric values in a symbolic Jacobian matrix? @J.M. I did not know that variables for D need not be a symbol. This is good to know. Jun14 revised How to substitute numeric values in a symbolic Jacobian matrix? I forgot to define variableVector Jun14 revised How to substitute numeric values in a symbolic Jacobian matrix? added 192 characters in body