
一些关于面试的
Joy-Coder
认真、严谨、求实、求是
展开
-
Jump Game
算法题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if yo原创 2015-06-23 20:13:41 · 424 阅读 · 0 评论 -
Combination Sum算法详解
Combination Sum I: 算法题目:Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen fro原创 2015-06-25 17:55:24 · 2304 阅读 · 0 评论 -
Multiply Strings
算法题目:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.大致意思:给定两个字符串数字num1,num2,数字可以无限大且非负,求这两个字符原创 2015-06-24 17:25:16 · 387 阅读 · 0 评论 -
Unique Paths 算法详解
算法题目:A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the原创 2015-06-25 15:42:07 · 685 阅读 · 0 评论 -
Permutation Sequence算法详解
算法题目:The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order, We get the following sequence (ie, for n = 3):“123” “132” “213” “231”原创 2015-06-24 18:06:37 · 1151 阅读 · 0 评论 -
Count Complete Tree Nodes算法详解
题目:Given a complete binary tree, count the number of nodes.Definition of a complete binary tree from Wikipedia: In a complete binary tree every level, except possibly the last, is completely filled, a原创 2015-06-26 20:17:16 · 720 阅读 · 0 评论 -
Maximal Square算法详解
Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing all 1’s and return its area.For example, given the following matrix:1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 Retu原创 2015-06-26 19:45:22 · 624 阅读 · 0 评论 -
Sqrt(x)算法详解
题目:Implement int sqrt(int x).Compute and return the square root of x.求x的开方牛顿迭代法求解: 计算x2 = n的解,令f(x)=x2-n,相当于求解f(x)=0的解,如左图所示。首先取x0,如果x0不是解,做一个经过(x0,f(x0))这个点的切线,与x轴的交点为x1。同样的道理,如果x1不是解,做一个经过(x1,f(x1))原创 2015-06-26 20:45:18 · 15607 阅读 · 0 评论 -
Set Matrix Zeroes算法详解
题目:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up: Did you use extra space? A straight forward solution using O(mn) spa原创 2015-06-30 22:51:03 · 539 阅读 · 0 评论