Solution to Min In Stack from Jobdu

10 Aug

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1522 Question Name: Min In Stack Question Description: implement a customized stack. It should provide a function min() to return the minimum value in the stack in O(1) time. Input: the input might contain multiple test cases. … Read More »

Solution to Print Matrix from Jobdu

10 Aug

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1391 Question Name: Print Matrix Question Description: Give an integer matrix, print it in spiral form. Input: the input might contain multiple test cases. Inside each test case, the first line includes two intergers N and M … Read More »

Solution to Power from Jobdu

5 Aug

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1514 Question Name: Power Question Description: Give a double and an integer, without using the math library, compute the base to the power of exponent. Input: may contains multiple test cases. The first line indicates how many … Read More »