r/compsci • u/TopcatTomki • Aug 14 '13
Algorithims Everyone Should Know?
What are some of you're favourite algoritms or concepts that you think everyone should know, whether they solve problems that crop up frequently, or are just beautiful in their construction?
377
Upvotes
View all comments
Show parent comment
3
u/MediumRay Aug 14 '13
I guess it could be useful in a compiler, if all of your registers were full of data you intended to use later on, and you want y in register b. This might be because you perform an operation on registers 0 to 4, or maybe register b is not easily accessable or something. Or maybe hand-writing assembly and you're branching into code for a different function or recursion or something and you want to shuffle the variables around.
Interesting to think... But I don't really know what I am talking about.