码迷,mamicode.com
首页 >  
搜索关键字:turn    ( 27138个结果
三个线程每个线程输出一个字符
#include #include #include #define NUM 3 int n=0; pthread_mutex_t t_mutex; pthread_cond_t t_cond; void *Execute(void *p) { int i=0; int para = (int)p;... ...
分类:编程语言   时间:2018-11-24 21:03:08    阅读次数:219
最长非降序子序列
输入:{5,3,4,8,6,7} 输出:4即{3,4,6,7} ...
分类:其他好文   时间:2018-11-24 21:00:59    阅读次数:149
两个队列实现栈
1 push(const T& element) 2 { 3 if(queue1.size()>0)//如果queue1不为空则往queue1中插入元素 4 queue1.push(element); 5 else if(queue2.size()>0)//如果queue2不为空则往queue2中插... ...
分类:其他好文   时间:2018-11-24 21:00:21    阅读次数:154
字符串内置函数的实现
1 char *MyStrcpy(char *des,const char *src) 2 { 3 assert(des != NULL && src != NULL); 4 char *pstr = des; 5 while((*pstr++ = *src++)!= '\0'); 6 return... ...
分类:其他好文   时间:2018-11-24 21:00:09    阅读次数:155
最长公共子串
int LCS(char *a,char *b) { if(a==NULL || b==NULL) return 0; int len_a = strlen(a); int len_b = strlen(b); int f[M][N]; for(int i=1;i f[i-1][j] ? f[i][... ...
分类:其他好文   时间:2018-11-24 20:59:05    阅读次数:144
#Leetcode# 60. Permutation Sequence
https://leetcode.com/problems/permutation-sequence/ The set [1,2,3,...,n] contains a total of n! unique permutations. By listing and labeling all of t ...
分类:其他好文   时间:2018-11-24 20:57:57    阅读次数:154
5.5 匿名方法中的捕获变量
class Program { static void Main(string[] args) { MethodInvoker m = CreateInvoker(); m(); m(); Console.ReadKey(); } ... ...
分类:其他好文   时间:2018-11-24 18:57:50    阅读次数:172
django中的CBV
CBV介绍 我们在写一个django项目时,通常使用的都是FBV(function base views) 而CBV(class base views)也有它自己的应用场景,比如在写一个按照rest规范写接口时,CBV的适用性就比FBV更强 先来看看CBV在django中的写法,与FBV有什么不同的 ...
分类:其他好文   时间:2018-11-24 18:00:07    阅读次数:228
412. Fizz Buzz
class Solution { public: vector fizzBuzz(int n) { vector res; for (int i = 1; i <= n; i++) { if (i % 3 == 0 && i % 5 == 0) res.push_back("FizzBuzz"); ... ...
分类:其他好文   时间:2018-11-24 17:07:53    阅读次数:169
用选择法对数组中n个整数按由小到大排序
#include void sort(int a[], int n) { int i, t, j; for(i=0; i<n-1; i++) { for(j=i+1; j<n; j++) { if(a[j]<a[i]) { t=a[i]; ... ...
分类:编程语言   时间:2018-11-24 16:42:56    阅读次数:337
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!