码迷,mamicode.com
首页 >  
搜索关键字:implement queue    ( 10759个结果
HDU 4912 Paths on the tree LCA 排序贪心
lca。。。 排个序然后暴力保平安 _(:зゝ∠)_  #pragma comment(linker, "/STACK:102400000,102400000") #include"cstdio" #include"iostream" #include"set" #include"queue" #include"string.h" using namespace std; #define...
分类:其他好文   时间:2014-08-05 19:25:00    阅读次数:299
Java 中队列的使用
刚才看见群里的一个朋友在问队列的使用,确实在现实的写代码中非常少使用队列的,反正我是从来没使用过。仅仅是学数据结构的时候学过。以下是我写的一个小样例,希望有不足之处请提出改正。O(∩_∩)O~看代码:import java.util.LinkedList;import java.util.Queue...
分类:编程语言   时间:2014-08-05 19:06:39    阅读次数:204
object-c编程tips-global_queue的一个小测试
前一段进行网络基础库构建的时候,网络发送的加密组包以及网络返回的回调解包处理都是在单独的主线程处理。 跟踪程序的时间发现这部分耗时还挺大,于是决定使用多线程处理,至少不应该使用主线程。 一直以来网上都在强调多线程的dispatch的妙用,自己仅仅是会用而没有实际测试过它的性能。今天将上次测试的结果发出来,说实话dispatch的多线程效率确实很高,跟cpu的核心数有很多关系。 测试思想: 使...
分类:其他好文   时间:2014-08-05 15:49:29    阅读次数:204
IO队列深度max_queue_depth对系统性能的影响
前段时间,发生了一个问题引起了我对IO队列深度的研究。存储服务器中linux kernel的mpt2sas驱动模块,将max_queue_depth设置为1024时,引起系统加载驱动时卡死,而调整为512则没问题。后来看了很多这方面的资料,终于弄明白了。我们为了追求系统的性能,往往将max_queu...
分类:其他好文   时间:2014-08-05 15:47:29    阅读次数:1633
优先队列
1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 // Empty the priority queue and print its contents. 9 templat...
分类:其他好文   时间:2014-08-05 00:38:18    阅读次数:203
二项队列
实现: 1 #ifndef BINOMIAL_QUEUE_H 2 #define BINOMIAL_QUEUE_H 3 4 #include 5 #include 6 #include "dsexceptions.h" 7 using namespace std; 8 9 ...
分类:其他好文   时间:2014-08-05 00:18:58    阅读次数:283
【LeetCode】Pow(x, n)
Implement pow(x, n). 思路:快速幂运算,需要考虑指数为负数,同时底数为0的情况,这种属于异常数据,代码里没有体现。 class Solution { public: double pow_abs(double x, unsigned int n) { if (n == 0) { return 1;...
分类:其他好文   时间:2014-08-04 21:32:48    阅读次数:314
LeetCode: LRU Cache [146]
【题目】Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the ...
分类:其他好文   时间:2014-08-04 21:10:27    阅读次数:218
复习css3的部分属性
利用css3实现一个半月形的西瓜,利用queue实现吃西瓜的动画。练习例子css3:1、圆角border-radius:100%;border-top-left-radius:5px;2、变形2D旋转:transform: rotate(25deg);(正角度为顺时针,负角度为逆时针)。3D旋转:t...
分类:Web程序   时间:2014-08-04 20:36:27    阅读次数:251
多线程同步
#include<stdio.h>#include<stdlib.h>#include<deque>#include<string>#include<string.h>#include<pthread.h>#include<signal.h>#include<assert.h>#include"clock.h"std::deque<std::string>task_queue;pthread_mutex..
分类:编程语言   时间:2014-08-04 14:43:17    阅读次数:279
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!