Here are 12 essential computing terms that are frequently used by computing students. Get to know them and prepare yourself for an exciting coding journey ahead.
This is the second post on the series of interesting thoughts of “programming concepts in real-life”. Today it occurred to me that one fundamental concept of programming – algorithm, is also heavily used in real life outside the IT world.
What is algorithm
Algorithm is a step-by-step procedure for calculations.
Algorithm used in programming
There are a lot of examples of algorithms in programming, the most basic ones include breadth-first search (BFS) and depth-first search (DFS).
Algorithm in real life
Algorithms are applied in our everyday life.
For example, for a freshman who just entered NUS, he may choose to study the area of his interest, such as marketing or psychology. He can do this in two ways, one is to really devote all the time and effort into this area and do nothing else for a very long time. So for marketing, he/she will be learning introductory modules on marketing, intermediate modules on marketing, advanced modules on marketing or even do a research on marketing. Only after he/she feels there is nothing else to do on marketing, then the person will consider other options. And surprisingly(or rather not surprisingly), this is exactly the concept of a particular algorithm called DFS. In DFS, you prioritize depth more than breadth, so when you have a chance to go wider or deeper, you will go deeper first.
And of course you can see how the opposite algorithm BFS works for real life. That is when a person takes all the introductory modules for different areas, however after all that still indecisive enough to make a decision for specialization. So he/she would take all the intermediate level modules for different areas and so on. This may work very badly for a freshman but the concept is similar to a liberal arts curriculum, where students are exposed to different disciplines for 1 or 2 years before they decide their major.
Amortized complexity optimization – CS3230 lecture on 13 Feb 2015
We use amortized complexity optimization in real life, for cleaning our rooms. Normally we do not clean our rooms every single day. We wait for the room to fall below a certain cleanliness standard or when there is an important visitor, then we start cleaning the room. Cleaning the room is an expensive operation which takes a lot of time. Hence, by doing it infrequently, only when absolutely necessary, we reduce the total amount of work needed to keep our room clean.
This idea is similar to amortized complexity optimization in algorithm analysis, where we optimize the average runtime to achieve better run time.
Other algorithms such as greedy algorithm and dynamic programming are also practised in real life(often without being realized).