Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3...
分类:
其他好文 时间:
2015-10-03 18:17:43
阅读次数:
161
Given a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened ...
分类:
其他好文 时间:
2015-10-03 18:17:01
阅读次数:
176
Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,...
分类:
其他好文 时间:
2015-10-03 18:13:25
阅读次数:
214
C/C++ 程序占用的内存分布: 栈区(stack): 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等。其操作方式类似于数据结构中的栈。 堆区(heap):一般由程序员分配释放, 若程序员不释放,程序结束时可能由OS回收 。 全局区(静态区)(static):全局变量和静态变量的存储...
分类:
编程语言 时间:
2015-10-02 01:28:35
阅读次数:
232
简化一个Unix风格下的文件路径。例如输入代表路径的字符串:"/home/",简化后为:"/home";或输入"/a/./b/../../c/",简化为:"/c"...
分类:
其他好文 时间:
2015-10-01 00:38:55
阅读次数:
272
assume cs:codestack segmentdb 16 dup(0)stack endscode segmentstart: mov ax,stack;将定义字形数据送入AX mov ss,ax;送入桟空间 mov sp,16;定义桟长度 mov a...
分类:
其他好文 时间:
2015-09-30 20:55:33
阅读次数:
180
assume cs:code,ss:stackstack segmentdb 16 dup(0)stack endscode segment mov ax,4c00h int 21h start: ...
分类:
其他好文 时间:
2015-09-30 20:51:31
阅读次数:
148
Java: 1 public class Solution { 2 public int calculate(String s) { 3 if (s == null || s.length() == 0) return 0; 4 Stack stack = n...
分类:
其他好文 时间:
2015-09-29 18:15:08
阅读次数:
203
typedef struct node * PNode;/*定义栈节点类型*/typedef struct node{ int data;//数据 PNode down;}Node;typedef struct stack{ PNode top; int size;}Stack;//创建一个...
分类:
其他好文 时间:
2015-09-29 16:16:10
阅读次数:
123
public class Stackextends VectorStack 类表示后进先出(LIFO)的对象堆栈。它通过五个操作对类 Vector 进行了扩展 ,允许将向量视为堆栈。它提供了通常的 push 和 pop 操作,以及取堆栈顶点的 peek 方法、测试堆栈是否为空的 empty 方法、在...
分类:
编程语言 时间:
2015-09-29 06:33:49
阅读次数:
212