Nick

亘古而常青的昨天永远是过去,也永远会再来。

腾讯2017秋招笔试编程题

1.[编程题] 编码时间限制:1秒 空间限制:32768K假定一种编码的编码范围是a ~ y的25个字母,从1位到4位的编码,如果我们把该编码按字典序排序,形成一个数组如下: a, aa, aaa, aaaa, aaab, aaac, … …, b, ba, baa, baaa, baab, b...

2017-07-11 17:53:36

阅读数:680

评论数:0

百度2017秋招笔试编程题

1.[编程题] 买帽子时间限制:1秒 空间限制:32768K度度熊想去商场买一顶帽子,商场里有N顶帽子,有些帽子的价格可能相同。度度熊想买一顶价格第三便宜的帽子,问第三便宜的帽子价格是多少? 输入描述: 首先输入一个正整数N(N <= 50),接下来输入N个数表示每顶帽子的价格(价格均是...

2017-07-10 20:37:14

阅读数:899

评论数:0

124 Binary Tree Maximum Path Sum 求二叉树的最大路径和

Given a binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in th...

2017-07-31 10:11:19

阅读数:160

评论数:0

104/111 Maximum/Minimum Depth of Binary Tree(二叉树求深度)

104 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the fart...

2017-07-29 15:11:33

阅读数:201

评论数:0

85 Maximal Rectangle (最大矩形)

Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area. For example, given the followin...

2017-07-27 19:48:28

阅读数:231

评论数:0

84 Largest Rectangle in Histogram(直方图中最大的矩形)

Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the his...

2017-07-26 17:32:48

阅读数:178

评论数:0

88/19 Merge Sorted Array/Remove Nth Node From End of List(指针运算)

88 Merge Sorted Array Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that ...

2017-07-25 10:40:31

阅读数:246

评论数:0

Ububtu16.04+GTX1070 环境配置

折腾如下: 硬件GTX1070 I5-6600k 华硕Z170i主板 海盗船DDR4 2400 8G×2 海盗船sfx 450电源 海盗船H50水冷 GT1850 12cm散热风扇 三星NVME SM951 512G SSD 银欣SG13b itx机箱系统WIN10 Ubuntu16.04...

2017-07-25 08:43:18

阅读数:1044

评论数:0

77 Combinations(组合数)

Given two integers n and k, return all possible combinations of k numbers out of 1 … n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,...

2017-07-24 21:35:18

阅读数:193

评论数:0

72 Edit Distance (编辑距离)

Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have ...

2017-07-23 16:48:14

阅读数:227

评论数:0

62/63 Unique Paths

62 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 eithe...

2017-07-21 12:12:14

阅读数:145

评论数:0

利用Hog特征和SVM分类器进行行人检测

之前介绍过Hog特征(http://blog.csdn.net/carson2005/article/details/7782726),也介绍过SVM分类器(http://blog.csdn.net/carson2005/article/details/6453502 );而本文的目的在于介绍利用...

2017-07-20 21:34:56

阅读数:248

评论数:0

目标检测的图像特征提取之HOG特征

目标检测的图像特征提取之(一)HOG特征zouxy09@qq.comhttp://blog.csdn.net/zouxy09 1、HOG特征:       方向梯度直方图(Histogram of Oriented Gradient, HOG)特征是一种在计算机视觉和图像处理中用来进行物体检测的特...

2017-07-20 21:31:11

阅读数:144

评论数:0

SIFT特征提取分析

SIFT(Scale-invariant feature transform)是一种检测局部特征的算法,该算法通过求一幅图中的特征点(interest points,or corner points)及其有关scale 和 orientation 的描述子得到特征并进行图像特征点匹配,获得了良好效...

2017-07-20 19:48:38

阅读数:229

评论数:0

54/59 Spiral Matrix 螺旋矩阵

54 Spiral Matrix Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example, Given the foll...

2017-07-20 12:05:08

阅读数:146

评论数:0

51/52 N-Queens(N皇后问题)

51 N-Queens dfs经典问题,采用回溯法求解。 经典的N皇后问题,基本所有的算法书中都会包含的问题,经典解法为回溯递归,一层一层的向下扫描,需要用到一个pos数组,其中pos[i]表示第i行皇后的位置,初始化为-1,然后从第0开始递归,每一行都一次遍历各列,判断如果在该位置放置皇...

2017-07-19 09:46:41

阅读数:204

评论数:0

55/45 Jump Game 跳跃游戏

55 Jump Game 思路:贪心算法,每次记录可以跳到的最远距离。class Solution { public: bool canJump(vector<int>& nums) { if(nums.empty()) return false;...

2017-07-18 10:26:41

阅读数:447

评论数:0

415/43 Add Strings/Multiply Strings

415 Add Strings class Solution { public: string addStrings(string num1, string num2) { reverse(num1.begin(), num1.end()); rever...

2017-07-17 15:55:48

阅读数:174

评论数:0

39/40. Combination Sum (两题)

39.Combination Sum 像这种结果要求返回所有符合要求解的题十有八九都是要利用到递归,而且解题的思路都大同小异,相类似的题目有 Path Sum II 二叉树路径之和之二,Subsets II 子集合之二,Permutations 全排列,Permutations II 全排列之二...

2017-07-15 19:55:00

阅读数:164

评论数:0

36/37. Sudoku Solver 数独问题

36 Valid Sudoku class Solution { public: bool isValidSudoku(vector<vector<char>>& board) { bool used[9]; for (in...

2017-07-14 11:38:01

阅读数:133

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭