09 2015 档案

摘要:Distinct SubsequencesGiven a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is... 阅读全文
posted @ 2015-09-12 11:42 舒克_贝塔 阅读(101) 评论(0) 推荐(0)
摘要:Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],... 阅读全文
posted @ 2015-09-10 20:54 舒克_贝塔 阅读(148) 评论(0) 推荐(0)
摘要:Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo... 阅读全文
posted @ 2015-09-10 10:37 舒克_贝塔 阅读(140) 评论(0) 推荐(0)
摘要:Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文
posted @ 2015-09-10 09:22 舒克_贝塔 阅读(105) 评论(0) 推荐(0)
摘要:1 bool is_sqrt(int n){ 2 for(int i=1;i=i/2;--j){23 a[i] = a[i]<(a[j]+a[i-j])?a[i]:(a[j]+a[i-j]);24 }25 }26 int temp =... 阅读全文
posted @ 2015-09-10 08:20 舒克_贝塔 阅读(721) 评论(0) 推荐(0)
摘要:#include#includeusing namespace std;//链表的归并排序struct listnode{ int value; listnode* next; listnode(int value):value(value),next(NULL){}};listn... 阅读全文
posted @ 2015-09-09 22:50 舒克_贝塔 阅读(244) 评论(0) 推荐(0)
摘要:一、先来先服务和短作业(进程)优先调度算法1.先来先服务调度算法先来先服务(FCFS)调度算法是一种最简单的调度算法,该算法既可用于作业调度,也可用于进程调度。当在作业调度中采用该算法时,每次调度都是从后备作业队列中选择一个或多个最先进入该队列的作业,将它们调入内存,为它们分配资源、创建进程,然后放... 阅读全文
posted @ 2015-09-08 16:49 舒克_贝塔 阅读(215) 评论(0) 推荐(0)
摘要:给定一个字符串,输出最长的重复子串举例:ask not what your countrycan do for you,but what youcan do for yourcountry最长的重复子串:can do for you思路:使用后缀数组解决分析:1、由于要求最长公共子序列,则需要找到字... 阅读全文
posted @ 2015-09-06 00:01 舒克_贝塔 阅读(1100) 评论(0) 推荐(0)
摘要:转:http://bbs.chinaunix.net/thread-1281954-1-1.html二动态链接库的特点与优势首先让我们来看一下,把库函数推迟到程序运行时期载入的好处:1.可以实现进程之间的资源共享。 什么概念呢?就是说,某个程序的在运行中要调用某个动态链接库函数的时候,操作系统首先会... 阅读全文
posted @ 2015-09-05 10:01 舒克_贝塔 阅读(345) 评论(0) 推荐(0)
摘要:参考他人思路而写,具体可参考:http://blog.csdn.net/anialy/article/details/7620469 1 #ifndef _HASHTABLE_ 2 #define _HASHTABLE_ 3 #include 4 using namespace std; ... 阅读全文
posted @ 2015-09-04 22:59 舒克_贝塔 阅读(199) 评论(0) 推荐(0)
摘要:1 /* 2 如果两个字符串的字符一样,但是顺序不一样,被认为是兄弟字符串, 3 问如何在迅速匹配兄弟字符串(如,bad和adb就是兄弟字符串)。 4 */ 5 #include 6 using namespace std; 7 8 int isBroStr(char *... 阅读全文
posted @ 2015-09-03 21:04 舒克_贝塔 阅读(587) 评论(0) 推荐(0)
摘要:已知: 每个飞机只有一个油箱, 飞机之间可以相互加油(注意是相互,没有加油机) 一箱油可供一架飞机绕地球飞半圈, 问题:为使至少一架飞机绕地球一圈回到起飞时的飞机场,至少需要出动几架飞机?(所有飞机从同一机场起飞,而且必须安全返回机场,不允许中途降落,中间没有飞机场)3架飞机5架次,飞法:ABC ... 阅读全文
posted @ 2015-09-03 16:54 舒克_贝塔 阅读(2829) 评论(0) 推荐(0)
摘要:在这里我们实现了一个简易的vector,没有利用到 stl中的内存分配器,内存分配利用的是new进行分配。其余功能大致实现1 #ifndef _NVECTOR_ 2 #define _NVECTOR_ 3 #include 4 #include 5 template 6 class nvector... 阅读全文
posted @ 2015-09-02 23:38 舒克_贝塔 阅读(170) 评论(0) 推荐(0)
摘要:1 #ifndef _MEMPOOL_H_ 2 #define _MEMPOOL_H_ 3 #include 4 template 5 class CMemPool{ 6 private: 7 CMemPool* m_pFreeList; 8 public: 9 enum{EAXP... 阅读全文
posted @ 2015-09-02 09:12 舒克_贝塔 阅读(247) 评论(0) 推荐(0)
摘要:递归: 1 void merge_array(int a[],int low,int mid,int end){ 2 int* temp = new int[end-low+1]; 3 int index_pre = low; 4 int index_post = mid+... 阅读全文
posted @ 2015-09-01 10:02 舒克_贝塔 阅读(207) 评论(0) 推荐(0)

点击右上角即可分享
微信分享提示