码迷,mamicode.com
首页 >  
搜索关键字:traverse    ( 100个结果
Binary Search Tree DFS Template
Two methods:1. Traverse2. Divide & Conquer 1 // Traverse: usually do not have return value 2 public class Solution { 3 public void traverse(TreeNo...
分类:其他好文   时间:2015-10-26 01:56:04    阅读次数:209
打印二叉树两个叶子节点间的路径
简要代码 /* * File : print binary tree road between leaf A and leaf B * Date : 2015/8/2 * Author : jinya * Assert A --> B * traverse root , left , right ; left , root , right ; left , right , root...
分类:其他好文   时间:2015-08-02 16:54:43    阅读次数:138
二叉树的遍历方法
二叉树先序递归遍历 1 int PreOrderTraverse(bitree T) 2 { 3 bitree p=T; 4 if(p) 5 { 6 coutdatalchild); 8 traverse(p->rchild); 9 }...
分类:其他好文   时间:2015-07-30 13:05:22    阅读次数:138
[LeetCode] Max Points on a Line
This problem has a naive idea, which is to traverse all possible pairs of two points and see how many other points fall in the line determined by them...
分类:其他好文   时间:2015-07-11 22:44:06    阅读次数:133
数据结构链表的操作集合(建立,遍历,插入,删除,排序,长度,空判断等)
#include #include #include typedef struct Node { int data;//数据域 struct Node * pNext;//指针域 }NODE, * PNODE; //NODE等价于struct Node, PNODE 等价于struct Node * //函数声明 void create_list(PNODE pHead);//创建一个动态链表 void traverse_list(PNOD...
分类:编程语言   时间:2015-06-30 22:10:14    阅读次数:158
List::traverse遍历
声明:// 遍历 void traverse(void (*)(T&)); //遍历,依次实施visit操作(函数指针,只读或局部性修改) template //操作器 void traverse(VST&); //遍历,依次实施visit操作(函数对象,可全局性修改)定义:template void List::tra...
分类:其他好文   时间:2015-05-28 23:10:57    阅读次数:386
Vector::traverse遍历
对Vector元素进行遍历,将遍历结果交由传递的函数使用:template void Vector::traverse(void (*visit)(T &)) //利用函数指针机制的遍历 { for (int i = 0; i < _size; i++) visit(_elem[i]); }template template <typenam...
分类:其他好文   时间:2015-05-21 15:40:28    阅读次数:326
找出字符串中第一个只出现一次的字符
find the first unique character in  a string and you can just traverse this string only one time. if there is no such character, just return '#' and '#' will not appear in the string, else return the ...
分类:其他好文   时间:2015-04-21 22:53:16    阅读次数:167
生成目录树形结构
"; traverse($sub_dir, $x + 1, $y + 1); } else { for ($i = 0; $i "; } }}$countFile = 0;function traverse2($path,...
分类:其他好文   时间:2015-04-13 12:38:33    阅读次数:137
二叉树三种遍历递归及非递归实现(Java)
import java.util.Stack; //二叉树三种遍历递归及非递归实现(Java) public class Traverse { /******************定义二叉树**************************/ private final int MAX_SIZE = 10; //链式存储 public static class BinaryTre...
分类:编程语言   时间:2015-03-19 16:24:16    阅读次数:241
100条   上一页 1 ... 6 7 8 9 10 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!