Java: get a set of random numbers from a specified range

This is a method that accepts a range (max) and a number (n), returns an array of n random numbers. n: size of random number array max: largest available number (exclusive) For example: Input: n=5, max=100 Output: an array containing 5 random numbers whose range is from 0 to 99. public static HashSet<Integer> getNRandom(int n, … Read more

Linux Process Programming – fork()

What is a process?

In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently.

Read more

How Compiler Works?

How compiler works is not easy to explain in one sentence. The best way is to use an example. A compiler is a computer program that transforms source code written in a high-level programming language into a lower level language. Basically, a compiler consists the following phases: Lexical Analysis, Syntax Analysis, Semantic Analysis, IR Generation, … Read more