November 5, 2013
32 bit, algorithms, assembly language, c / c++, code, implementation, interpreter / compiler, optimization, programming languages, windows
Introduction You probably came across the term ‘Tail Recursion’ or ‘Tail Recursive’ before. You even have written a piece of Tail Recursive functions/algorithms without knowing it. So, what is …
Question: Implement integer square root for int sqrt(int x) There are many ways to compute the integer square root. But if you don’t bother, you can always cheat the compilers …
Question: You are climbing stairs. It takes n steps to get to the top. Each time, you can take 1 step or 2 steps. How many distinct ways to get to …
Question: Given an unsorted list of integers, find out the first missing positive. Problem Description: http://oj.leetcode.com/problems/first-missing-positive/ Examples: should return 3; should return 2. Can you do it with O(n) …
Well, I have a detailed post that presents two solutions to solve the classic n-queen problem. The problem asks you to find the number of solutions to put n queens in …