How often have you encountered this scenario?
You open a problem, read the problem statements, and realize that it requires a fast algorithm, because of many complexities behind it. And soon you realize again that the algorithm must really fast: the time limit is too strict.
And you learn many optimizations from many resources, and wonder which optimizations really take effect.
UVa Online Judge is a great place to practice programming. It has hundreds of programming problems already, of many categories. By default it organizes the problems into chapters, not into the problems’ categories. So there are chapter I, II, etc.
But sometimes we want to practice a specific category of problems.
For example, we are learning dynamic programming, and want to try some DP problems. It is of course annoying to open every problem and to check whether or not it is feasible to solve with DP. There must be a solution to this dilemma.
I think it’s hard for us to implement a complicated algorithm, write down the code once, compile it, run, and get the expected result, in one shot. That rarely happens. Most of us will encounter some minor or major bugs in the code, and spend some time to find out what’s happening and debug. Programmer is a debugger, an old saying tells us.
No, it is not a brand new programming language or technology. It is a term for a program source code that has valid syntax of several programming languages. That is, it can be correctly compiled in several languages. The resulting executable files of resulting compilation in different languages will perform exactly the same operation or output.
What’s the first sorting algorithm you know?
I’m pretty sure that you have learned some sorting algorithms before. Maybe bubble sort, insertion sort, selection sort, or quicksort. Some of them are easy to code; some are quite tricky.
Sorting is crucial in some tasks. Fortunately sorting is made easier if you’re using C++ language.
As you learn new algorithms, you will find that it’s easier to remember them by trying to really code them in your chosen programming language. You may also have been solving programming problems and realize that some standard algorithms are used extensively and repetitively. What I want to suggest you is to create your own code library.


