Tag: algorithm
Given an index k, return the k-th row of the Pascal’s triangle. For example, given k = 3, Return . Could you optimize your algorithm to use only O(k) …
Given an integer n, return the number of trailing zeroes in Factorial N! Your solution should be in logarithmic time complexity. Naive/Bruteforce Solution It is easy to get the …
I have asked a question on stackoverflow: inline int test(int n, int tag, int flag) { if (0 == flag) return ((n & tag) == tag); return ((n & …
This puzzle is from Leetcode Online Judge and this may appear quite often during interviews. This puzzle asks you to find the minimal sum for a number triangle. You …
September 14, 2014
algorithms, BASH Shell, batch script, beginner, code, code library, console, data structure, implementation, linux, programming languages, Shell Scripts
If you major in Computer Science, you must know the 8-queens problem, which is a classical Artificial Intelligent problem that can be solved using back tracing. Previous posts can …