码迷,mamicode.com
首页 >  
搜索关键字:typedef struct    ( 24378个结果
[Leetcode][Tree][Binary Tree Level Order Traversal ]
树的层次遍历,比较简单,3个题的做法完全一样,只是在特定的地方对结果进行reverse。1、Binary Tree Level Order Traversal/** * Definition for binary tree * struct TreeNode { * int val; * ...
分类:其他好文   时间:2014-07-07 16:39:56    阅读次数:194
[Leetcode][Tree][Same Tree]
非常简单的一道题/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x...
分类:其他好文   时间:2014-07-07 16:25:49    阅读次数:220
Problem Populating Next Right Pointers in Each Node
Problem Description:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Popul...
分类:其他好文   时间:2014-07-07 15:45:18    阅读次数:166
[Leetcode][Tree][Depth of Binary Tree]
计算树的深度1、minimum depth of binary tree 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * ...
分类:其他好文   时间:2014-07-07 15:31:40    阅读次数:182
分享一个关于pthread线程栈在mm_struct里面的分布问题
大家好,本人被下面这个问题困扰了一段时间,最近似乎找到了答案。这里和大家分享一下,可能对有相同困惑的同学有点帮助,同时也请各位帮忙看看错漏的地方。1================问题:在使用pthread库创建两个线程时clone()被调用了两次,可以用strace 看到:intmain(){.....
分类:编程语言   时间:2014-07-07 15:08:35    阅读次数:209
[Leetcode][Tree][Construct Binary Tree from Preorder/Postorder and Inorder Traversal ]
从树的中序遍历+前/后序遍历重建一棵树。必须使用iterator才能过,否则会MLE。1、preorder + inorder第一个版本,使用坐标范围: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int...
分类:其他好文   时间:2014-07-07 14:11:10    阅读次数:147
[Leetcode][Tree][Symmetric Tree]
如果按层次遍历,存下每一层的点,会MLE。1、递归版本:关键还是子问题的划分。 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * ...
分类:其他好文   时间:2014-07-07 13:58:07    阅读次数:181
[Leetcode][Tree][Balanced Binary Tree]
判断一棵树是不是平衡二叉树,之前做过,还有点印象,用一个函数返回树的高度,如果是-1的话,就说明子树不平衡。1A很开心~ 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * T...
分类:其他好文   时间:2014-07-07 13:56:05    阅读次数:180
C安全编码--预处理
建议和规则建议:用内联函数或静态函数代替与函数相似的宏在宏参数名两边加上括号宏替换列表应该加上括号应该使用typedef定义编码类型不要复用标准头文件名理解连接标记或执行字符串化时的宏替换把头文件放在包含防护条件中避免使用连续的问号保证头文件名唯一不要用不安全的函数替换安全函数在一个do-while...
分类:其他好文   时间:2014-07-03 11:38:46    阅读次数:258
Linux内核中的jiffies及其作用介绍及jiffies等相关函数详解
在LINUX的时钟中断中涉及至二个全局变量一个是xtime,它是timeval数据结构变量,另一个则是jiffies,首先看timeval结构struct timeval{time_t tv_sec; /***second***/susecond_t tv_usec;/***microsecond*...
分类:系统相关   时间:2014-07-02 00:54:24    阅读次数:631
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!