Problem Description:There areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas ta...
分类:
其他好文 时间:
2014-07-07 15:52:25
阅读次数:
231
Problem Description:Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your alg...
分类:
其他好文 时间:
2014-07-07 15:47:17
阅读次数:
272
Problem Description:Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your pr...
分类:
其他好文 时间:
2014-07-07 15:46:01
阅读次数:
267
Problem Description:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Popul...
分类:
其他好文 时间:
2014-07-07 15:45:18
阅读次数:
166
Problem Description:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1...
分类:
其他好文 时间:
2014-07-07 15:41:32
阅读次数:
247
Problem Description:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For ex...
分类:
其他好文 时间:
2014-07-07 15:29:11
阅读次数:
280
Problem Description:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit...
分类:
其他好文 时间:
2014-07-07 15:24:41
阅读次数:
212
Problem Description:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most...
分类:
其他好文 时间:
2014-07-07 15:24:05
阅读次数:
206
/* 本文是选择问题: 选择一组N个数当中的第k小的数(第k大的数类似) 集中方法的实现代码*/#include "sorting.h"#include "fatal.h"#define SORTING_BUBBLE1#define SORTING_INSERTION2#define SORTING...
分类:
其他好文 时间:
2014-07-07 15:22:12
阅读次数:
222
原题: UVA 1169 http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3610大白书上的原题。代码:#include #include #include ...
分类:
其他好文 时间:
2014-07-07 15:09:20
阅读次数:
386