码迷,mamicode.com
首页 >  
搜索关键字:oc 遍历    ( 32540个结果
Symmetric Tree
题目 Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric: 1 / 2 2 / \ / 3 4 4 3 ...
分类:其他好文   时间:2014-06-08 18:12:04    阅读次数:248
Binary Tree Zigzag Level Order Traversal
题目 Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). For example: G...
分类:其他好文   时间:2014-06-08 17:29:07    阅读次数:315
C#中遍历当前所有进程时存在的陷阱
有时候我们希望我们所写的exe在机器上同一时间只能有一个实例进行运行。通常我们会采取遍历当前所有的进程,如果有的进程exe所在的物理路径就是当前exe的物理路径的话,那么说明这个exe已经启动过一次了,就不再启动了。但是注意,这里有一些需要注意的小细节。 有时候对于编写一个应用程序的守护进程的时候,也要用到这个遍历方法。即我需要另外启动一个进程,这个进程启动后,要查看所有的进程,看看其所检测...
分类:其他好文   时间:2014-06-08 17:20:29    阅读次数:289
Swift编程语言初探
继WWDC2014后,新的编程语言Swift浮出水面,它具有快速、现代、安全、可交互等特征,并且其语法简单,入门门槛低,有望替代语法复杂难懂的Objective-C语言。据其作者Chris Lattner在博客上声称,该语言开发只用了4年时间,并且底层框架基本上都是由其一人开发完成。     按照惯例,先用Swift来编写一个简单的"Hello World" println("Hello Wo...
分类:编程语言   时间:2014-06-08 15:50:40    阅读次数:235
Recover Binary Search Tree
题目 Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note: A solution using O(n) space is pretty straight forward. Cou...
分类:其他好文   时间:2014-06-08 15:32:45    阅读次数:245
List集合中两种遍历方式
遍历List集合中的元素的方法有两种: 第一种:利用迭代器遍历 代码1: // 迭代器 Iterator it=list.iterator(); while(it.hasNext()) { System.out.println(it.next()); }或者代码2: for(Iterator it=list.iterator();it.hasNext();) { System.o...
分类:其他好文   时间:2014-06-08 15:22:50    阅读次数:189
【leetcode】Construct Binary Tree from Preorder and Inorder Traversal
问题: 给定二叉树的前序和中序遍历,重构这课二叉树. 分析: 前序、中序、后序都是针对于根结点而言,所以又叫作先根、中根、后根(当然不是高跟)。 前序:根  左 右 中序:左  根 右 对二叉树,我们将其进行投影,就会发现个有趣的事: 发现投影后的顺序,恰好是中序遍历的顺序,这也就是为什么在构造二叉树的时候,一定需要知道中序遍历,因为中序遍历决定了结点间的相对左右位置关系。所...
分类:其他好文   时间:2014-06-08 15:20:12    阅读次数:214
初识Swift
今天,不容易弄到一个xcode 6,装上之后感受一把Swift。 Hello World 新建一个工程,看看久违的Hello World 变量与常量 在Swift中变量声明用var,常量的声明用let。 这里和oc和c还是有不一样的地方。 判断 switch case 4: case 5:println("5") 会报错...
分类:其他好文   时间:2014-06-08 14:51:05    阅读次数:248
Maximum Depth of Binary Tree
题目 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. 方法 使用DFS对树进行遍...
分类:其他好文   时间:2014-06-08 10:26:33    阅读次数:207
Java集合02----LinkedList的遍历方式及应用
Java集合02----LinkedList的遍历方式及应用      前面已经学习了ArrayList的源码,为了学以致用,故列举一些ArrayList的遍历方式及应用。JDK源码学习系列05----LinkedList 1.LinkedList的遍历方式 a.一般的for循环(随机访问) int size = list.size(); for (int i=0; i<size; i...
分类:编程语言   时间:2014-06-08 09:24:51    阅读次数:290
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!