码迷,mamicode.com
首页 >  
搜索关键字:stack    ( 9691个结果
HDU 5402 (构造题) Travelling Salesman Problem
题意略。思路比赛的时候其实已经意识到是一个构造题了。 蓝儿m,n都是偶数的时候搞崩了。sad。。 m,n有一个是奇数不说了,可以走完所有。 两个都是偶数的时候,我们就去找一个最小的值且它的位置坐标和是奇数,然后就绕开这个走。其他都可以走完辣。参考code:/* #pragma warning (disable: 4786) #pragma comment (linker, "/STACK:...
分类:其他好文   时间:2015-08-18 22:47:52    阅读次数:127
40个Java集合面试问题和答案
1.Java集合框架是什么?说出一些集合框架的优点? 每种编程语言中都有集合,最初的Java版本包含几种集合类:Vector、Stack、HashTable和Array。随着集合的广泛使用,Java1.2提出了囊括所有集合接口、实现和算法的集合框架。在保证线程安全的情况下使用泛型和并发集合类,Java已经经历了很久。它还包括在Java并发包中,阻塞接口以及它们的实现。集合框架的部分优点如下:...
分类:编程语言   时间:2015-08-18 19:41:21    阅读次数:220
UVA - 12263 Rankings 模拟(拓扑排序)
1 #pragma comment(linker, "/STACK:1000000000") 2 #include 3 #define LL long long 4 #define INF 0x3f3f3f3f 5 #define IN freopen("E.in","r",stdin...
分类:编程语言   时间:2015-08-18 18:42:07    阅读次数:128
关于JS堆栈与拷贝
1、栈(stack)和堆(heap) stack为自动分配的内存空间,它由系统自动释放;而heap则是动态分配的内存,大小不定也不会自动释放。 2、基本类型和引用类型 基本类型:存放在栈内存中的简单数据段,数据大小确定,内存空间大小可以分配。 5种基本数据类型有Undefined、...
分类:Web程序   时间:2015-08-18 18:09:07    阅读次数:127
atcoder 它February 29th
Time limit: 2sec /Stack limit: 256MB /Memory limit: 256MBProblemCharlie was born January 1st of the yearA, on the Earth. He will leave the Earth on De...
分类:其他好文   时间:2015-08-18 15:57:18    阅读次数:147
java-集合类(二)
使用场景 1.多线程 (1)在jdk1.5之前原始的集合类中,只有vector、stack、hashtable、enumeration等是线程安全的,其他的都是非线程安全的。 非线程安全的集合在多线程操作中,会出现脏数据,如 final List tickets = new ArrayList(); for (int i = 0; i 100000; i++) {...
分类:编程语言   时间:2015-08-18 12:07:00    阅读次数:146
java异常拾遗
概述 当方法内部发生一项错误时,该方法会创建一个对象传递给运行时系统(runtime system),这个对象被称为异常对象,包含错误的类型、发生位置,程序状态等一系列信息。 当一个方法抛出异常时,运行时系统会沿着调用栈(call stack)寻找该异常的处理方式 。 下图中,调用栈下面的方法调用了上面的方法,层层嵌套,一共四层: 调用第三个方法时抛出了一个异常,运行时系统就会...
分类:编程语言   时间:2015-08-18 09:06:42    阅读次数:175
Implementing Stacks Using Queues
Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top()...
分类:其他好文   时间:2015-08-18 06:32:36    阅读次数:90
手动扩栈
方案一:(普通版)#pragma comment(linker, "/STACK:102400000,102400000")方案二:(汇编版)const int main_stack = 16; char my_stack[128<<20];int main() { __asm__("movl %%esp, (%%eax);\n"::"a"(my_stack):"memory");...
分类:其他好文   时间:2015-08-17 21:52:18    阅读次数:183
PAT 1086. Tree Traversals Again (25)
1086. Tree Traversals Again (25)An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that whe...
分类:其他好文   时间:2015-08-17 21:31:19    阅读次数:97
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!