General Discussions

Algorithm in Layman’s Terms

Layman: What’s an algorithm? He: Do you see that how you always find out a easier way of doing things given to you? Sometimes its the long road and sometimes its the shortcut. You always have a ‘way’ to do things. From basic common sense to expert knowledge! Layman: Yeah!! He: That, for that, we… Continue reading Algorithm in Layman’s Terms

General Discussions

main() – int or void?

Programmers generally use a int main() or a void main() Every function should return a type. Either a success status or a failure status. Even main is a function and should return a type. It is not advisable to use void main(). It should always be int main(). A void main() means it returns no status… Continue reading main() – int or void?

General Discussions

Machine – Input/Output

Every system is made up of atleast the following components: Input States Initial State Transitions Output Machine is also a system. Systems make transition from one state to another based on the input. The result of such transitions is the output. You feed something to machine to get something desired out of it. What you… Continue reading Machine – Input/Output

General Discussions

Counting Word Occurrences From Huge Files

Let us say we were given to count all the occurrences of all the words from a million pages in ONE days time (24 hours). How can we do that? Here is a possible design: Pick up a dictionary which has all the words that ever exists. Get the count of number of words –… Continue reading Counting Word Occurrences From Huge Files