码迷,mamicode.com
首页 >  
搜索关键字:思路分析    ( 794个结果
Leetcode: Construct Binary Tree from Inorder and Postorder Traversal
题目: Given inorder and postorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree. 根据二叉树的中序遍历和后续遍历结果构造二叉树。思路分析: 这道题和上道题《 Leetcode: Constr...
分类:其他好文   时间:2015-04-04 00:02:22    阅读次数:180
Leetcode: Construct Binary Tree from Preorder and Inorder Traversal
题目: Given preorder and inorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree. 根据前序遍历和中序遍历结果构造二叉树。思路分析: 分析二叉树前序遍历和中序遍历的结果我们发现: 二叉树中序遍...
分类:其他好文   时间:2015-04-03 22:32:25    阅读次数:234
怎么编写微博爬虫 图片爬虫
背景:实验室大数据分析需要得到社交网站的数据,首选当然是新浪。数据包括指定关键词、话题、位置的微博的内容。字段包括:图片、时间、用户、位置信息。思路分析:要爬新浪的数据主要有2种方法: 1.微博开发者平台提供的微博API,资源包括微博内容、评论、用户、关系、话题等信息。同时,你也可以申请高级接口、....
分类:其他好文   时间:2015-04-01 10:53:59    阅读次数:268
杭电oj1005解题
1005AC+解题思路分析:1,题中(1 #define M 52intmain(){ inta,b,n,i,f[M]={0,1,1},t; while(scanf("%d %d %d",&a,&b,&n),a!=0||b!=0||n!=0) { a%=7;b%=7; for(i=3;i4)brea...
分类:其他好文   时间:2015-03-30 20:29:48    阅读次数:126
PHP 四种基本排序算法的代码实现
前提:分别用冒泡排序法,快速排序法,选择排序法,插入排序法将下面数组中的值按照从小到大的顺序进行排序。$arr(1,43,54,62,21,66,32,78,36,76,39);1.冒泡排序思路分析:在要排序的一组数中,对当前还未排好的序列,从前往后对相邻的两个数依次进行比较和调整,让较大的数往下沉...
分类:编程语言   时间:2015-03-30 11:06:39    阅读次数:131
LeetCode First Missing Positive
Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant space.思路分析:...
分类:其他好文   时间:2015-03-29 13:39:00    阅读次数:106
Leetcode: Longest Common Prefix
题目: Write a function to find the longest common prefix string amongst an array of strings. 即求给定的一组字符串的公共前缀。思路分析: 一个一个寻找前缀,先比较第一个和第二个,找到公共前缀,然后公共前缀和第三个比较,寻找公共前缀,以此类推。C++参考代码:class Solution { public:...
分类:其他好文   时间:2015-03-21 20:01:49    阅读次数:173
LeetCode Maximum Depth of Binary Tree
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 farthest leaf node.思路分析:这题比较简单,关于树的题目通常都可以用递归解决,这题也不例外,递归解法的思...
分类:其他好文   时间:2015-03-19 06:23:34    阅读次数:126
LeetCode Same Tree
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.思路分析:判断两个树是否相同,基本也...
分类:其他好文   时间:2015-03-19 06:23:30    阅读次数:95
四则运算第二次作业
一.要求:1、题目避免重复; 2、可定制(数量/打印方式); 3、可以控制下列参数: 是否有乘除法、 是否有括号、 数值范围、 加减有无负数、 除法有无余数、 否支持分数 (真分数, 假分数, …)、 是否支持小数 (精确到多少位)、 打印中每行的间隔可调整;二.思路分析: (1...
分类:其他好文   时间:2015-03-15 16:30:33    阅读次数:151
794条   上一页 1 ... 60 61 62 63 64 ... 80 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!