Category: C/C++
There is a popular IQ question, e.g. according to the first few number patterns, find the answer to the input: 1234 = 0 4567 = 1 2345 = 0 …
Hashing is an important technique in Computer Science. There are many cases that you can use Hash to speed up your algorithms (e.g. by reducing from O(n^2) to O(n) …
Question: Given a positive integer (nature number) N, count the number of ‘1’s between number 1 to N inclusive. For example, when N = 2, the answer is 1, …
I have seen a naive implementation at work today (written by a colleague). My colleague intends to generate a number that is power of two, and the number is …
In C/C++, if you want to clear an array by filling a byte-value, you can use the following: void * __cdecl memset(void *_Dst, int Val, size_t _Size) This allows …